Package coprs :: Module error_handlers :: Class BaseErrorHandler
[hide private]
[frames] | no frames]

Class BaseErrorHandler

source code

Known Subclasses:

Do not use this class for handling errors. It is only a parent class for the actual error-handler classes.

Instance Methods [hide private]
 
handle_error(self, error)
Return a flask response suitable for the current situation (e.g.
source code
 
code(self, error)
Return status code for a given exception
source code
 
message(self, error)
Return an error message for a given exception.
source code
Method Details [hide private]

handle_error(self, error)

source code 

Return a flask response suitable for the current situation (e.g. reder HTML page for UI failures, send JSON back to API client, etc).

This method is expected to be implemented in descendants of this class.

message(self, error)

source code 

Return an error message for a given exception. We want to obtain messages differently for `CoprHttpException`, `HTTPException`, or others.