mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-08-06 02:21:42 +00:00
Improve error handling to spare the server log from user's malformed requests and stop trying to parse data from providers if the HTTP status was not 200
This commit is contained in:
@@ -74,7 +74,7 @@ class APILookupCallHandler(tornado.web.RequestHandler):
|
||||
self.set_status(422)
|
||||
|
||||
except Exception as e:
|
||||
logging.error(e)
|
||||
logging.error("Exception when handling client request to call lookup API: %s", e, exc_info=True)
|
||||
self.write(safe_json_dumps("Error - an internal server error occurred."))
|
||||
self.set_status(500)
|
||||
|
||||
@@ -126,7 +126,7 @@ class APILookupSIGRefHandler(tornado.web.RequestHandler):
|
||||
self.set_status(422)
|
||||
|
||||
except Exception as e:
|
||||
logging.error(e)
|
||||
logging.error("Exception when handling client request to sig ref lookup API: %s", e, exc_info=True)
|
||||
self.write(safe_json_dumps("Error - an internal server error occurred."))
|
||||
self.set_status(500)
|
||||
|
||||
@@ -188,7 +188,7 @@ class APILookupGridHandler(tornado.web.RequestHandler):
|
||||
self.set_status(422)
|
||||
|
||||
except Exception as e:
|
||||
logging.error(e)
|
||||
logging.error("Exception when handling client request to grid ref lookup API: %s", e, exc_info=True)
|
||||
self.write(safe_json_dumps("Error - an internal server error occurred."))
|
||||
self.set_status(500)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user