SamsHTTPError
– HTTP Errors¶
-
class
SamsHTTPError
(error: werkzeug.exceptions.HTTPException)¶ All generic HTTP errors will be raised with this error.
The
app_code
will be the suppliedhttp_code
prefixed with03
. For example:from flask import abort abort(401, description='Not allowed to do that') # will raise the following error { "error": "03401", "name": "SamsHTTPError", "description": "Not allowed to do that" }
This method solely exists to catch errors that are raised from underlying frameworks, such as
Eve
orFlask
It is advised not to use
abort
directly, instead implement a new exception that extends theSamsException
class.