Improved exception handling
Improved exception-handling by now raising standard WebSocketException
from Starlette
with edited reason🛠️
This causes the connection to terminate immediately and should provide more friendly reasoning in browser logging.
Exceptions are caused by:
- unable to JSON-parse the incoming message.
- the JSON-parsed message not matching the
pydantic
-schema. - unable to find a matching operation-type.
- the connection has timed out at an application level (e.g. due to a max lifespan restriction or minimum application-level heartbeat).