mstar.utils.client_errors#
Client-visible text for an exception raised while serving a request.
Functions
|
Return |
|
Replace each absolute file path in |
- mstar.utils.client_errors.client_error_text(exc, what, *, log=logger, type_name=True, traceback=True)[source]#
Return
(text, error_id): what a client may see forexc.A
ValueErrororTypeErroris a refusal raised on purpose, so it keeps its message (prefixed with the type name whentype_name), with absolute paths cut to their base names. Anything else becomesinternal error (error id <id>). Either way the full error and its traceback (left out whentracebackis False, for an error already logged where it happened) go tologas<what> [error id <id>].