BaseHTTPException
Generic exception All the exception that extends this exceptions are considered a excepted exceptions and those are not logged in the console nor the logging file
Attributes
detail: strdetail_args: Dictheaders: Dictinstance_id: strshow_as: Literalunique_code: strFunctions
__init__
Throw a generic exception
http_status_code :
int HTTP error code
detail :
str Human redable message of the error
unique_code :
str Unique code to recognize the error,
if not provided, a code is generated with filename and method name (that raised the exception)
detail_args :
Dict if provided, it replace the arg in the detail message (between double bracket {{}}) with the corresponding dict value
headers :
Dict if specific header need to be returned in the HTTP response
instance_id :
str Unique id for this exception instance. Only provide when it was generated by another exception
show_as :
Literal - error Mode to show the error in the interface, if error it will be showed in an error box.
If info, in info box.
get_detail_with_args
Replace the arguments in the exception message with dict corresponding values For example : detail = 'Hello {{name}}' and detail_args = {"name" : "Bob"}, the message that will be show will be 'Hello bob'
Return type :
str