-
Notifications
You must be signed in to change notification settings - Fork 54
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
Server exceptions #31
Comments
added exception logging in dispatcher try:
result = task.result()
except OSError:
pass
except ... |
Handling |
The bad side is that OSError is too common: try:
raise ConnectionRefusedError("FOO")
except OSError as exc:
print("OSError")
print(exc) What if wrap all path-io methods with something like: try:
...
except:
raise PathIOError This will be much easier to handle without any checks. I don't really know what is the best practies for this. Help are welcome. |
import traceback
class PathIOError(Exception):
pass
try:
try:
raise ConnectionRefusedError
except:
raise PathIOError
except PathIOError:
print("error handle")
traceback.print_exc()
|
@pohmelie that what i was saying in #28 ("unfortunatelly, stream.read(connection.block_size) ... can raise OSError as well") |
@rsichny I don't get why we should not handle other path errors? Cause if we wont, then connection will be closed on exception. Any path-io error (even timeout) will disconnect user from server. And I don't get why we should handle only one(two) operations in #28? |
This is straight continue of #28 discuss.
Which exceptions should server handle globaly? Globaly means in
dispatcher
coroutine.OSError
is one of them. What information should server provide to user, except 451 return code? As far as I know,OSError
is platform dependent and dispatching error codes will be annoying.What else exception should server care about?
The text was updated successfully, but these errors were encountered: