Add TT WS API (#28599)
* Add TT WS API * Add a test * Correctly convert TT errrors
This commit is contained in:
1 parent
b2071b81c1
commit
bd54ff3c02
7 files changed
+93
-20
No files matched your search
@@ -108,6 +108,8 @@ class ActiveConnection:
|
||||
@callback
|
||||
def async_handle_exception(self, msg, err):
|
||||
"""Handle an exception while processing a handler."""
|
||||
log_handler = self.logger.error
|
||||
|
||||
if isinstance(err, Unauthorized):
|
||||
code = const.ERR_UNAUTHORIZED
|
||||
err_message = "Unauthorized"
|
||||
@@ -120,6 +122,8 @@ class ActiveConnection:
|
||||
else:
|
||||
code = const.ERR_UNKNOWN_ERROR
|
||||
err_message = "Unknown error"
|
||||
log_handler = self.logger.exception
|
||||
|
||||
log_handler("Error handling message: %s", err_message)
|
||||
|
||||
self.logger.exception("Error handling message: %s", err_message)
|
||||
self.send_message(messages.error_message(msg["id"], code, err_message))
|
||||
Reference in new issue
Block a user