pigeon.default.errors¶
Module Contents¶
- class pigeon.default.errors.Manager¶
Used to manage settings and load specified middleware which is only loaded at runtime.
To override settings either the method Manager.override or the Manager.__get_attr__ method is used:
# override settings using a module or similar behaving object my_settings: types.ModuleType = ... Manager.override(my_settings) # override settings one at a time by accessing the attributes (__getattr__) Manager.my_setting = my_value
- classmethod override(new_settings: types.ModuleType | Any)¶
Overrides current settings with new settings provided.
- Parameters:
new_settings – New settings to override old ones with
- class pigeon.default.errors.HTTPResponse(headers: dict = None, data: str = None, status: int = 200, cookies=None, protocol: str = '1.1', content_type=None, **kwargs)¶
Bases:
pigeon.http.message.HTTPMessage
An HTTP message (obv either response or request)
- property is_error¶
- class pigeon.default.errors.HTTPRequest(method: str, path: str, headers: dict = None, get: dict = None, data=None, files=None, protocol: str = '1.1', content_type=None, **kwargs)¶
Bases:
pigeon.http.message.HTTPMessage
An HTTP message (obv either response or request)
- property is_error¶
- pigeon.default.errors.string_template = Multiline-String¶
Show Value
""" <style> body { background-color: black; color: white; margin: 0 2rem; } .head { padding: 2rem 1rem 0; font-family: Arial; } .status-code { color: #c74a4a; } .traceback { background-color: #141414; padding-left: 1.5rem; border-radius: 1rem; } .reminder { font-family: Arial; padding: 0 1rem; } .debug-mode { color: #c7bd4a; } </style> <h1 class="head">HTTP Status <span class="status-code">{{status}}</span></h1> <pre class="traceback"> <code> {{traceback}} </code> </pre> <h3 class="reminder">You are seeing this message because your application is running in <span class="debug-mode">DEBUG MODE</span></h3> """
- pigeon.default.errors.debug_template¶
- pigeon.default.errors.fallback(request: pigeon.http.request.HTTPRequest | None, code: int)¶
Fallback for when no specific error view is provided for status code