-
-
Notifications
You must be signed in to change notification settings - Fork 109
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
doc: ProtocolError and PermissionDenied are for client bugs #644
base: main
Are you sure you want to change the base?
Conversation
The exceptions ProtocolError and PermissionDenied are both raised by qubesd to indicate various problems with requests. However, both cause clients to print the extremely unhelpful "Got empty response from qubesd" message. Therefore, they should only be used for client *programming* errors (bugs), not for problems that the client could not have detected before making the request. The current code does not obey these rules, but these violations are bugs and should eventually be fixed.
I don't like this approach, it more or less says "don't use those" which reduces granularity of errors. There may be cases where error message is intentionally not sent to the user to not leak info that shouldn't be available to the caller, but that's probably very limited case. Maybe a better approach is to simply improve the error message, or send ProtocolError/PermissionDenied exceptions back to the user with a generic message? PS black is not happy with your changes |
The problem is that |
So, maybe |
I think so, yes, but some of the uses of My understanding is:
|
Yes, the above is quite good summary, |
In fact, it would be good to adjust this PR to include the above explanation. And then fix exceptions usage (in this PR or another). |
The exceptions ProtocolError and PermissionDenied are both raised by qubesd to indicate various problems with requests. However, both cause clients to print the extremely unhelpful "Got empty response from qubesd" message. Therefore, they should only be used for client programming errors (bugs), not for problems that the client could not have detected before making the request.
The current code does not obey these rules, but these violations are bugs and should eventually be fixed.