Exceptions Module API Reference¶
This section documents the internals of the exceptions
module in Bijux CLI.
bijux_cli.core.exceptions ¶
Defines the custom exception hierarchy for the Bijux CLI.
This module provides a set of custom exception classes that inherit from the base BijuxError
. This hierarchy allows for more specific error handling and helps standardize error reporting throughout the application. Each exception can carry contextual information, such as the command that was running when the error occurred.
BijuxError ¶
Bases: Exception
Base exception for all custom errors in the Bijux CLI.
Attributes:
-
command
(str | None
) –The name of the command being executed when the error occurred.
-
http_status
(int
) –An HTTP-like status code used to derive the final CLI exit code.
Parameters:
-
message
(str
) –The human-readable error message.
-
command
(str | None
, default:None
) –The name of the command.
-
http_status
(int | None
, default:None
) –The associated status code.
Initialize the base BijuxError exception.
Source code in src/bijux_cli/core/exceptions.py
CliTimeoutError ¶
Bases: BijuxError
Raised for timeout errors (deprecated).
Note
This exception is deprecated. Use CommandError
or Python's built-in TimeoutError
for new code.
Parameters:
-
message
(str
) –The human-readable error message.
-
command
(str | None
, default:None
) –The name of the command.
-
http_status
(int | None
, default:None
) –The associated status code. Defaults to 504.
Initialize the CliTimeoutError exception.
Source code in src/bijux_cli/core/exceptions.py
CommandError ¶
Bases: BijuxError
Raised for command execution failures.
This exception is used for command-specific errors, such as invalid arguments or missing resources, that represent a client-side error.
Parameters:
-
message
(str
) –The human-readable error message.
-
command
(str | None
, default:None
) –The name of the command.
-
http_status
(int | None
, default:None
) –The associated status code. Defaults to 400.
Initialize the CommandError exception.
Source code in src/bijux_cli/core/exceptions.py
ConfigError ¶
Bases: BijuxError
Raised for configuration loading or parsing failures.
Parameters:
-
message
(str
) –The human-readable error message.
-
command
(str | None
, default:None
) –The name of the command.
-
http_status
(int | None
, default:None
) –The associated status code. Defaults to 400.
Initialize the ConfigError exception.
Source code in src/bijux_cli/core/exceptions.py
ServiceError ¶
Bases: BijuxError
Raised for service-related failures.
This exception is used for errors originating from core services like Observability, Telemetry, or the Registry.
Parameters:
-
message
(str
) –The human-readable error message.
-
command
(str | None
, default:None
) –The name of the command.
-
http_status
(int | None
, default:None
) –The associated status code. Defaults to 500.
Initialize the ServiceError exception.
Source code in src/bijux_cli/core/exceptions.py
ValidationError ¶
Bases: BijuxError
Raised for validation failures (deprecated).
Note
This exception is deprecated. Use CommandError
for new code.
Parameters:
-
message
(str
) –The human-readable error message.
-
command
(str | None
, default:None
) –The name of the command.
-
http_status
(int | None
, default:None
) –The associated status code. Defaults to 400.
Initialize the ValidationError exception.