Situation
Currently, exceptions work fine in Docbuild. However, we are unsure if this might become important in the future.
Use Case
For example, a ValueError may be a bit too unspecific for certain situations. A more specific, docbuild-ish custom exception could be helpful.
Possible Implementation
A small set of custom exception may be helpful:
DocbuildError(Exception): a base exception for all custom exceptions raised by this tool.
ConfigError(DocbuildError): a base exception for any configuration-related failures.
InvalidConfigError(ConfigError, ValueError): for configuration errors that doesn't adhere to the model (for TOML) or contains validation errors (for portal files).
ModelValidationError(DocbuildError, ValueError): A base for errors during data model processing.
RepositoryError(DocbuildError): A base for Git-related failures.
Situation
Currently, exceptions work fine in Docbuild. However, we are unsure if this might become important in the future.
Use Case
For example, a
ValueErrormay be a bit too unspecific for certain situations. A more specific, docbuild-ish custom exception could be helpful.Possible Implementation
A small set of custom exception may be helpful:
DocbuildError(Exception): a base exception for all custom exceptions raised by this tool.ConfigError(DocbuildError): a base exception for any configuration-related failures.InvalidConfigError(ConfigError, ValueError): for configuration errors that doesn't adhere to the model (for TOML) or contains validation errors (for portal files).ModelValidationError(DocbuildError, ValueError): A base for errors during data model processing.RepositoryError(DocbuildError): A base for Git-related failures.