Classes
ErrorCode
0
▼
ErrorCode
0
▼
MiloError
2
▼
Base error for all milo errors.
MiloError
2
▼
Base error for all milo errors.
Methods
format_compact
0
str
▼
Format error for terminal display, consistent with kida's format_compact().
format_compact
0
str
▼
def format_compact(self) -> str
Returns
str
Internal Methods 1 ▼
__init__
5
▼
__init__
5
▼
def __init__(self, code: ErrorCode, message: str, *, suggestion: str = '', context: dict[str, Any] | None = None, docs_url: str = '') -> None
Parameters
| Name | Type | Description |
|---|---|---|
code |
— |
|
message |
— |
|
suggestion |
— |
Default:''
|
context |
— |
Default:None
|
docs_url |
— |
Default:''
|
InputError
0
▼
Input-related errors (raw mode, escape parsing).
InputError
0
▼
Input-related errors (raw mode, escape parsing).
StateError
0
▼
State-related errors (reducer, dispatch, saga).
StateError
0
▼
State-related errors (reducer, dispatch, saga).
FormError
0
▼
Form-related errors (validation, field).
FormError
0
▼
Form-related errors (validation, field).
AppError
0
▼
App lifecycle errors.
AppError
0
▼
App lifecycle errors.
FlowError
0
▼
Flow errors (transitions, screens).
FlowError
0
▼
Flow errors (transitions, screens).
DevError
0
▼
Dev server errors (watch, reload).
DevError
0
▼
Dev server errors (watch, reload).
ConfigError
0
▼
Configuration errors (parse, merge, validate).
ConfigError
0
▼
Configuration errors (parse, merge, validate).
PipelineError
0
▼
Pipeline orchestration errors (phase, timeout, dependency).
PipelineError
0
▼
Pipeline orchestration errors (phase, timeout, dependency).
PluginError
0
▼
Plugin system errors (load, hook).
PluginError
0
▼
Plugin system errors (load, hook).
Functions
format_error
1
str
▼
Format any error for terminal display.
Uses format_compact() for kida Template…
format_error
1
str
▼
def format_error(error: Exception) -> str
Format any error for terminal display.
Uses format_compact() for kida TemplateErrors and MiloErrors. Falls back to str() for other exceptions.
Parameters
| Name | Type | Description |
|---|---|---|
error |
Exception |
Returns
str
format_render_error
3
str
▼
Format a render error with optional error template rendering.
Tries to render …
format_render_error
3
str
▼
def format_render_error(error: Exception, *, template_name: str = '', env: Any = None) -> str
Format a render error with optional error template rendering.
Tries to render through the built-in error.txt template. Falls back to format_error() if template rendering fails.
Parameters
| Name | Type | Description |
|---|---|---|
error |
Exception |
|
template_name |
str |
Default:''
|
env |
Any |
Default:None
|
Returns
str
_get_error_code
1
str
▼
Extract error code string from any error.
_get_error_code
1
str
▼
def _get_error_code(error: Exception) -> str
Parameters
| Name | Type | Description |
|---|---|---|
error |
Exception |
Returns
str
_get_hint
1
str
▼
Extract hint/suggestion from an error.
_get_hint
1
str
▼
def _get_hint(error: Exception) -> str
Parameters
| Name | Type | Description |
|---|---|---|
error |
Exception |
Returns
str
_get_docs_url
1
str
▼
Extract docs URL from an error.
_get_docs_url
1
str
▼
def _get_docs_url(error: Exception) -> str
Parameters
| Name | Type | Description |
|---|---|---|
error |
Exception |
Returns
str