fix
This commit is contained in:
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
|
||||
[project]
|
||||
name = "common"
|
||||
description = "Reusable code stubs"
|
||||
version = "0.1.3"
|
||||
version = "0.1.4"
|
||||
requires-python = ">=3.13"
|
||||
authors = [
|
||||
{ name="BreakerBear", email="breakerbear@autistic.men" },
|
||||
|
||||
@@ -123,11 +123,15 @@ async def handler(request: ws.WebSocketRequest):
|
||||
mid = inbound.id
|
||||
res = inbound.fulfill()
|
||||
except json.decoder.JSONDecodeError: err = Error.PARSE_ERROR
|
||||
except Request.ParamsError: err = Error.INVALID_PARAMS
|
||||
except TypeError: err = Error.INVALID_REQUEST
|
||||
except KeyError: err = Error.METHOD_NOT_FOUND
|
||||
except Exception as e:
|
||||
err = Error.INTERNAL_ERROR
|
||||
exc = e
|
||||
except ws.ConnectionClosed as e:
|
||||
logger.critical('Going away', exc_info=e)
|
||||
return
|
||||
|
||||
if err is not None: logger.error(err.message(), exc_info=exc)
|
||||
if mid is not None: await connection.send_message(str(Response(mid, err or res)))
|
||||
|
||||
Reference in New Issue
Block a user