Exceptions¶
Exception hierarchy for error handling.
Base Exception¶
EzplError
¶
Bases: Exception
Base exception class for all Ezpl-related errors.
All custom exceptions in the Ezpl framework inherit from this base class, enabling centralized exception handling and consistent error reporting. Each exception includes a message and optional error code for categorization.
Initialize the Ezpl error.
| PARAMETER | DESCRIPTION |
|---|---|
message
|
Human-readable error message
TYPE:
|
error_code
|
Optional error code for categorization and debugging
TYPE:
|
Note
Error codes follow the pattern: COMPONENT_ERROR or OPERATION_ERROR (e.g., "CONFIG_ERROR", "FILE_ERROR") for consistent error tracking.
Source code in src/ezpl/core/exceptions.py
Specific Exceptions¶
ConfigurationError¶
Bases: EzplError
Exception raised for configuration-related errors.
This exception is raised when configuration loading, validation, or processing encounters issues. The optional config_key attribute helps identify which configuration parameter caused the problem.
Initialize the configuration error.
| PARAMETER | DESCRIPTION |
|---|---|
message
|
Human-readable error message
TYPE:
|
config_key
|
Optional configuration key that caused the error
TYPE:
|
Source code in src/ezpl/core/exceptions.py
LoggingError¶
Bases: EzplError
Exception raised for logging-related errors.
This exception covers issues with logging operations such as file writing, format processing, or handler initialization. The optional handler_type attribute identifies which handler (console, file) caused the error.
Initialize the logging error.
| PARAMETER | DESCRIPTION |
|---|---|
message
|
Human-readable error message
TYPE:
|
handler_type
|
Optional handler type that caused the error (e.g., "file", "console")
TYPE:
|
Source code in src/ezpl/core/exceptions.py
ValidationError¶
Bases: EzplError
Exception raised for validation errors.
This exception is raised when input validation fails (e.g., invalid log levels, malformed configuration values). The optional field_name and value attributes help identify what was being validated when the error occurred.
Initialize the validation error.
| PARAMETER | DESCRIPTION |
|---|---|
message
|
Human-readable error message
TYPE:
|
field_name
|
Optional field name that failed validation
TYPE:
|
value
|
Optional value that failed validation
TYPE:
|
Source code in src/ezpl/core/exceptions.py
InitializationError¶
Bases: EzplError
Exception raised for initialization errors.
This exception is raised when Ezpl components fail to initialize properly. The optional component attribute identifies which component (printer, logger, config) encountered the initialization issue.
Initialize the initialization error.
| PARAMETER | DESCRIPTION |
|---|---|
message
|
Human-readable error message
TYPE:
|
component
|
Optional component that failed to initialize
TYPE:
|
Source code in src/ezpl/core/exceptions.py
FileOperationError¶
Bases: EzplError
Exception raised for file operation errors.
This exception covers issues with file operations (reading, writing, creating files). The optional file_path and operation attributes help identify which file and operation (read, write, create) failed.
Initialize the file operation error.
| PARAMETER | DESCRIPTION |
|---|---|
message
|
Human-readable error message
TYPE:
|
file_path
|
Optional file path that caused the error
TYPE:
|
operation
|
Optional operation that failed (e.g., "read", "write", "create")
TYPE:
|
Source code in src/ezpl/core/exceptions.py
HandlerError¶
Bases: EzplError
Exception raised for handler-related errors.
This exception covers issues with logging handlers (initialization, configuration, operation failures). The optional handler_name attribute identifies which handler (EzPrinter, EzLogger) caused the problem.
Initialize the handler error.
| PARAMETER | DESCRIPTION |
|---|---|
message
|
Human-readable error message
TYPE:
|
handler_name
|
Optional handler name that caused the error
TYPE:
|