exceptions
Exceptions that the CLI raises
All other exceptions will inherit from CLIException
so just catching that should be enough
CLIException
¶
Base class for all exceptions raised by CLI
__init__(self, message, fix=None, exit_code=7)
special
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message |
str |
this will be printed to the console |
required |
fix |
str |
(if defined) what steps can be taken to fix the error |
None |
exit_code |
int |
what the exit code should be if this exception was raised |
7 |
Source code in aicrowd/exceptions.py
def __init__(
self, message: str, fix: str = None, exit_code: int = errors.UNKNOWN_ERROR
):
"""
Args:
message: this will be printed to the console
fix: (if defined) what steps can be taken to fix the error
exit_code: what the exit code should be if this exception was raised
"""
super().__init__(message)
self.message = message
self.fix = fix
self.exit_code = exit_code