a8e880fad6
Replace die()/RuntimeError at the point of detection with a typed MissingEnvVarError, and catch it in the CLI dispatcher alongside ManifestError. Library code stays free of stderr output; the CLI renders all user-facing error lines in one place. Sites updated: egress.egress_resolve_token_values (unset/empty token), git_gate._provision_dynamic_key and revoke_git_gate_provisioned_keys (missing forge_token_env), env.resolve_env (unset interpolated var). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
19 lines
666 B
Python
19 lines
666 B
Python
"""bot-bottle application-level exception hierarchy.
|
|
|
|
Exceptions here are caught by the CLI dispatcher (``cli/__init__.py``)
|
|
and rendered as ``bot-bottle: error: …`` lines — same UX as ``die()``,
|
|
but without coupling library code to stderr output."""
|
|
|
|
from __future__ import annotations
|
|
|
|
|
|
class MissingEnvVarError(Exception):
|
|
"""Raised when a required host environment variable is unset or empty.
|
|
|
|
``var_name`` is the exact name of the missing variable so callers
|
|
can display it without re-parsing the message string."""
|
|
|
|
def __init__(self, var_name: str, message: str) -> None:
|
|
self.var_name = var_name
|
|
super().__init__(message)
|