1.

How to handle application Errors in Flask?

Answer»

When our application launches, for various reasons applications and servers may FAIL. It is very common to face exceptions in the production build. Sometimes our codebase is completely OK, although it can throw exceptions. You may be wondering, why does that happen? Some reasons behind server errors are given below:

  • If the client canceled the request early and the application is still running and it reading data from the server
  • If the database is OVERLOADED with tons of queries
  • Hard drive on the server may crash
  • Filesystem on the server is full
  • Backend server may crash
  • Network connection of the server may fail
  • Logical error in our program

That's just a small sample of the problems we COULD face. So, how do we deal with such a situation? If our application is running in production mode and an EXCEPTION occurs, Flask will show us a very plain page and log the exception to the logger by default.



Discussion

No Comment Found