summaryrefslogtreecommitdiff
path: root/src/home/api/errors
diff options
context:
space:
mode:
Diffstat (limited to 'src/home/api/errors')
-rw-r--r--src/home/api/errors/__init__.py1
-rw-r--r--src/home/api/errors/api_response_error.py28
2 files changed, 0 insertions, 29 deletions
diff --git a/src/home/api/errors/__init__.py b/src/home/api/errors/__init__.py
deleted file mode 100644
index efb06aa..0000000
--- a/src/home/api/errors/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from .api_response_error import ApiResponseError
diff --git a/src/home/api/errors/api_response_error.py b/src/home/api/errors/api_response_error.py
deleted file mode 100644
index 85d788b..0000000
--- a/src/home/api/errors/api_response_error.py
+++ /dev/null
@@ -1,28 +0,0 @@
-from typing import Optional, List
-
-
-class ApiResponseError(Exception):
- def __init__(self,
- status_code: int,
- error_type: str,
- error_message: str,
- error_stacktrace: Optional[List[str]] = None):
- super().__init__()
- self.status_code = status_code
- self.error_message = error_message
- self.error_type = error_type
- self.error_stacktrace = error_stacktrace
-
- def __str__(self):
- def st_formatter(line: str):
- return f'Remote| {line}'
-
- s = f'{self.error_type}: {self.error_message} (HTTP {self.status_code})'
- if self.error_stacktrace is not None:
- st = []
- for st_line in self.error_stacktrace:
- st.append('\n'.join(st_formatter(st_subline) for st_subline in st_line.split('\n')))
- s += '\nRemote stacktrace:\n'
- s += '\n'.join(st)
-
- return s