Documentation

API Reference

Epochly API Reference: Exceptions

Epochly exception classes, error codes, and handling patterns for robust error recovery.

Exception classes raised by Epochly.


EpochlyError

Base exception class for all Epochly errors.

from epochly import EpochlyError
try:
epochly.configure(invalid_param=True)
except EpochlyError as e:
print(f"Epochly error: {e}")

EpochlyConfigError

Raised for configuration errors.

from epochly import EpochlyConfigError
try:
epochly.configure(enhancement_level=99) # Invalid level
except EpochlyConfigError as e:
print(f"Configuration error: {e}")

EpochlyCompatibilityError

Raised when optimization is not compatible with the environment.

from epochly import EpochlyCompatibilityError
try:
epochly.set_level(4) # GPU not available
except EpochlyCompatibilityError as e:
print(f"Compatibility error: {e}")

Catching License Errors

Use the base EpochlyError to catch license-related errors.

from epochly import EpochlyError
try:
epochly.configure(enhancement_level=4) # Requires Pro license
except EpochlyError as e:
print(f"License error: {e}")

EpochlyInitializationError

Raised when Epochly fails to initialize a component.

from epochly import EpochlyInitializationError
try:
result = optimized_function(bad_data)
except EpochlyInitializationError as e:
print(f"Initialization error: {e}")

Exception Hierarchy

EpochlyError
├── EpochlyConfigError
├── EpochlyCompatibilityError
└── EpochlyInitializationError