mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-20 14:27:42 +00:00
Logging tidy-up, IDE inspection fixes
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user