PythonRMV/pyrmv/errors/unknown_error.py

15 lines
480 B
Python
Raw Normal View History

2022-09-23 14:53:33 +03:00
class UnknownError(Exception):
"""Exception raised but error is not known.
### Attributes:
* errorCode: Client error code from HAFAS ReST Request Errors.
* errorText: Description of an error occurred.
"""
def __init__(self, errorCode: str, errorText: str):
self.errorCode = errorCode
self.errorText = errorText
super().__init__(self.errorText)
def __str__(self):
return f'{self.errorCode} -> {self.errorText}'