Functions
_is_kida_error
1
bool
▼
Check if an exception originates from the kida template engine.
_is_kida_error
1
bool
▼
def _is_kida_error(exc: BaseException) -> bool
Parameters
| Name | Type | Description |
|---|---|---|
exc |
BaseException |
Returns
bool
_is_app_frame
1
bool
▼
True if the frame is from the application (not stdlib/site-packages).
_is_app_frame
1
bool
▼
def _is_app_frame(filename: str) -> bool
Parameters
| Name | Type | Description |
|---|---|---|
filename |
str |
Returns
bool
format_template_error
2
str
▼
Format a Kida template error for terminal display.
Uses ``exc.format_compact()…
format_template_error
2
str
▼
def format_template_error(exc: BaseException, request: Request | None = None) -> str
Format a Kida template error for terminal display.
Usesexc.format_compact()and wraps it with a banner and
request context (when available).
Parameters
| Name | Type | Description |
|---|---|---|
exc |
BaseException |
A Kida template exception (TemplateError subclass). |
request |
Request | None |
The request that triggered the error (optional). Default:None
|
Returns
str
format_compact_traceback
1
str
▼
Format a non-template error with compact traceback.
Shows only application fra…
format_compact_traceback
1
str
▼
def format_compact_traceback(exc: BaseException) -> str
Format a non-template error with compact traceback.
Shows only application frames + error summary, suppressing framework internals from kida, starlette, uvicorn, anyio.
Parameters
| Name | Type | Description |
|---|---|---|
exc |
BaseException |
Any exception. |
Returns
str
format_minimal_error
1
str
▼
One-line error summary for minimal verbosity.
format_minimal_error
1
str
▼
def format_minimal_error(exc: BaseException) -> str
Parameters
| Name | Type | Description |
|---|---|---|
exc |
BaseException |
Any exception. |
Returns
str
log_error
2
None
▼
Log an internal error with appropriate formatting.
Detects Kida template error…
log_error
2
None
▼
def log_error(exc: BaseException, request: Request | None = None) -> None
Log an internal error with appropriate formatting.
Detects Kida template errors and formats them cleanly. For non-template
errors, uses the traceback verbosity level fromCHIRP_TRACEBACK
(compact, full, minimal). Defaults to compact.
This replaces the rawlogger.exception()call in
handle_internal_error().
Parameters
| Name | Type | Description |
|---|---|---|
exc |
BaseException |
The exception that caused the 500 error. |
request |
Request | None |
The request that triggered the error (optional for streaming/SSE contexts where a request may not be available). Default:None
|