yera.apps.exceptions
App-specific exceptions.
Symbols
AppExit
BaseExceptionAppQuitRequest to end the current app run immediately.
Raised by exit. Subclasses BaseException,
like SystemExit, so an app's own except Exception handlers do not
swallow it. The outermost app catches it and emits the run's single exit
event.
Attributes
Process-style exit code; 0 for success.
Human-readable summary of why the run ended.
Value the run returns, checked against the outermost app's declared return type on success.
Optional structured cause metadata for failure exits.
Methods
AppExit.__init__
__init__(
exit_code: int,
reason: str,
return_value: object,
error_cause: ErrorCause | None = None,
) → NoneBuild an app exit request with its result and diagnostic details.
Parameters
Process-style code describing whether the run succeeded.
Human-readable explanation for ending the run.
Value to return from the outermost app.
Structured metadata describing a failure, if present.
AppQuit
AppExitRequest to end the current app run because the user chose to stop.
Raised by quit. Carries no return value, so
it is not checked against the app's declared return type.
Methods
AppQuit.__init__
__init__() → NoneBuild a successful exit request representing a user-initiated quit.
AppRuntimeError
RuntimeErrorRaised when an app exits with a non-zero exit code.
Raised by the app decorator instead of calling sys.exit, so callers can catch a normal exception and e.g. call sys.exit(exit_code) in a runner.
Methods
AppRuntimeError.__init__
__init__(
message: str,
exit_code: int,
reason: str | None = None,
app_name: str | None = None,
app_identifier: str,
error_cause: ErrorCause,
) → NoneBuild an exception describing an unsuccessful app run.
Parameters
User-facing description of the runtime failure.
Process-style non-zero failure code.
App-supplied explanation for the failure, if available.
Display name of the failed app, if available.
Stable identifier of the failed app.
Structured metadata describing the underlying failure.
ErrorCause
BaseModelStructured metadata about the cause of an app exit error.
Always includes error_type. May include additional fields like block_type for specific error types (e.g., UnsupportedAwaitUserBlockError).