Logging tidy-up, IDE inspection fixes

This commit is contained in:
Ian Renton
2026-08-15 07:42:38 +01:00
parent 9cd6d9c177
commit bff5b79f8f
40 changed files with 128 additions and 125 deletions
+6 -6
View File
@@ -57,8 +57,8 @@ class APISpotsHandler(tornado.web.RequestHandler):
except ValueError as e:
self.write(safe_json_dumps("Bad request - " + str(e)))
self.set_status(400)
except Exception as e:
logging.error("Excedption when handling client request to spots API: %s", e, exc_info=True)
except Exception:
logging.exception("Excedption when handling client request to spots API")
self.write(safe_json_dumps("Error - an internal server error occurred."))
self.set_status(500)
self.set_header("Cache-Control", "no-store")
@@ -107,8 +107,8 @@ class APISpotsStreamHandler(tornado_eventsource.handler.EventSourceHandler):
# argument.
self._sse_spot_broadcaster.register(self)
except Exception as e:
logging.warning("Exception when serving SSE socket: %s", e, exc_info=True)
except Exception:
logging.exception("Exception when serving SSE socket")
self.close()
def close(self):
@@ -127,8 +127,8 @@ class APISpotsStreamHandler(tornado_eventsource.handler.EventSourceHandler):
spot = copy.deepcopy(spot)
spot.infer_missing(self._credentials)
self.write_message(msg=safe_json_dumps(spot))
except Exception as e:
logging.warning("Exception in SSE callback, connection will be closed: %s", e, exc_info=True)
except Exception:
logging.exception("Exception in SSE callback, connection will be closed")
self.close()