Exceptions & Errors#
Prept API uses the following errors to indicate different types of failures during generation or manipulation of boilerplates.
- class prept.PreptError#
The base class for all exceptions raised by Prept.
- class prept.PreptCLIError(message: str, hint: str | None = None)#
Exception class to aid errors related to CLI.
This inherits both
PreptErrorandclick.ClickException.Changed in version 0.2.0: Multi-line message and hint now support proper indentation formatting in error output.
- class prept.ConfigNotFound#
Error raised when an operation is performed in directory which is not a boilerplate.
- class prept.InvalidConfig(key: str | None, *args: Any, **kwargs: Any)#
Error raised when preptconfig.json contains invalid or unprocessable data.
- Parameters:
key (
str| None) –The key causing the error.
If not present, the error is caused by malformed or unparseable boilerplate configuration.
- class prept.BoilerplateNotFound(name: str)#
Error raised when an operation is performed on a boilerplate that is not installed.
- Parameters:
name (
str) – The name of boilerplate that caused the error.
- class prept.TemplateProviderNotFound(spec: str, reason: str)#
Error raised when template provider is not found, not installed, or has invalid name.
- class prept.EngineNotFound(spec: str, reason: str)#
Error raised when generation engine could not be found.