Skip to content
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

Document exceptions [and/or do the detailed I/O rework] #84

Open
tcoopman opened this issue Jun 30, 2021 · 3 comments
Open

Document exceptions [and/or do the detailed I/O rework] #84

tcoopman opened this issue Jun 30, 2021 · 3 comments

Comments

@tcoopman
Copy link
Contributor

For example, Dream.send might fail if the socket is not connected anymore. I believe it would be useful if these exceptions are documented in the API reference.

@aantron
Copy link
Owner

aantron commented Jun 30, 2021

Agreed, thanks.

@aantron aantron added this to the alpha3 milestone Jun 30, 2021
@aantron
Copy link
Owner

aantron commented Jun 30, 2021

Also leaving a note to myself to document more clearly Dream's "philosophy" about exceptions.

For the time being, I'll sketch it here. Dream prefers encoding errors that can be caused by the client in types (option, result), and programming errors (like trying to access a path parameter that was not defined in your route) as exceptions.

Closed WebSockets are debatable, since I think Dream currently offers no good way to know if the socket was closed by the client, besides the exception itself.

There will be some reworks of "side" information flow (like sockets closing) in the future, hopefully without touching the main "data" API too much.

@tcoopman
Copy link
Contributor Author

Closed WebSockets are debatable, since I think Dream currently offers no good way to know if the socket was closed by the client, besides the exception itself.

I agree, that's something I want to partly try to address in what I'm implementing at the moment (#75) where I would like to have a heartbeat in both directions. So there is at least some way of knowing when a client has lost the connection / closed (and maybe offer reconnection possibilities)

@aantron aantron changed the title Document exceptions Document exceptions [and/or do the detailed I/O rework] Jul 3, 2021
@aantron aantron removed this from the alpha3 milestone Feb 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants