-
Notifications
You must be signed in to change notification settings - Fork 2
fix: server response for user context error #287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: server response for user context error #287
Conversation
-inherits from PermissionError -created to distinguish this specific configuration error from other PermissionErrors
- not catching PermissionErrors was what was originally causing no JSON response to be returned from the server when setegid, setgroups, or seteuid failed. Even those these specific errors are not caught by the custom error class and handler, I left in the global PermissionError handler to catch other instances where a PermissionError might not be caught in a specific method
- catch PermissionErrors in EffectiveUserContext.__enter__() and raise the new custom error class instead
krokicki
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Actually, I wonder if |
I added a check before raising the custom error. If use_access_flags is false, then the PermissionError is raised as-is. |
The error message was replicated in three places. Doing this means we can set it once but still override it if needed.
neomorphic
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I refactored the error message into the UserContextConfigurationError class so it doesn't need to be written three times.
2874ca6
into
mkitti-handle-internal-server-errors-file-queries
Clickup id: 86ae98yg2
This PR adds error handling for user context configuration issues related to access flags and server privileges. It also adds a global error handler for permission errors, to handle any future cases where permission errors are not otherwise caught.
Addresses this comment in PR #283
@krokicki