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