MCPcopy Create free account
hub / github.com/dbunt1tled/python-fast-api / __init__

Method __init__

src/core/exception/exceptions.py:9–22  ·  view source on GitHub ↗
(self, error_no: ErrorNo, message: str, inner_exception: Exception | None = None)

Source from the content-addressed store, hash-verified

7
8class DomainException(Exception):
9 def __init__(self, error_no: ErrorNo, message: str, inner_exception: Exception | None = None):
10 self.errorNo = error_no.value
11 self.inner_exception = inner_exception
12 self.traceback = traceback.format_exc() if inner_exception else None
13 self.tracestack = None
14 stack = inspect.stack()
15 if len(stack) > 1:
16 frame = stack[1]
17 self.tracestack = f"Error in function '{frame.function}': {frame.code_context[0].strip() if frame.code_context else None}, file '{frame.filename}' at line '{frame.lineno}"
18 full_message = message
19 if inner_exception:
20 full_message += f" → {str(inner_exception)}"
21 self.message = full_message
22 super().__init__(full_message)
23
24 def type(self) -> str:
25 return "domain"

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected