Exception Hierarchy
Plexe’s exceptions inherit from a basePlexeError
class:
Base Exception
PlexeError
Base exception for all Plexe-specific exceptions.
Specification Errors
SpecificationError
Base class for errors related to model specification.
InsufficientSpecificationError
Raised when the natural language specification is insufficiently detailed.
AmbiguousSpecificationError
Raised when the natural language specification is ambiguous or contradictory.
InvalidSchemaError
Raised when the input or output schema is invalid.
Instruction Errors
InstructionError
Base class for errors related to instructions provided for model building.
Constraint Errors
ConstraintError
Base class for errors related to constraints.
Runtime Errors
PlexeRuntimeError
Base class for runtime errors during model execution or training.
CodeExecutionError
Raised when code execution fails for reasons other than timeout.
Handling Exceptions
Note: The list of exception classes above represents the current implementation. In future versions, additional exception types may be added to provide more specific error information.Basic Exception Handling
Specific Exception Handling
Prediction Error Handling
Best Practices
- Catch Specific Exceptions: Target the most specific exception class that makes sense for your use case.
- Log Detailed Information: Include full exception details in logs for debugging.
- Graceful Degradation: When possible, handle errors in a way that allows your application to continue functioning.
- User-Friendly Messages: Transform technical error details into actionable user messages.
- Retry Strategies: Implement retries for transient errors like LLM provider issues.