Closed snekiam closed 4 years ago
@snekiam Howdy, I have been looking into making the catchall handler, and have come up with some ideas in the iss182_catchall_logger branch.
One issue I was having was using the Flask-based Exception handling. It was not able to handle the exceptions we have been discussing. I think this is because they are Errors in the database query, not a Flask one.
Also, the database needs to be updated to allow storage of the new data. Which I think I could do, but I don't want to mess up the data.
I'm guessing this can be figured out on Sunday, but for the future I can also work on most days.
@ethanahlquist Hmm, I thought you could catch any exception through the flask error handler - I think OperationalError is from sqlalchemy. Lets talk about it today.
Objective
Similar to the way we handle
OperationalError
in the flask_api, we should have a catchall to log what happens for uncaught exeptionsKey Result
Details
(as of now) Flask_api has the following:
to catch OperationalErrors. We should modify this/change this to handle more than just OperationalErrors (like IndexErrors, etc) and log them.
Additional context Python errors all follow object oriented design (I think), so I think we can catch a generic
Exception
and check what type it is to handle different ones differently.