Coverage for /home/runner/work/coxbuild/coxbuild/src/coxbuild/exceptions.py: 100%
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1class CoxbuildException(Exception):
2 """Common base exception for all coxbuild exceptions."""
4 def __init__(self, message: str, cause: Exception | None = None) -> None:
5 """
6 Create CoxbuildException.
8 message: exception mesage
9 cause: inner exception
10 """
11 super().__init__()
12 self.message = message
13 self.cause = cause
15 def __str__(self) -> str:
16 return f"{self.message}{f' ({repr(self.cause)})' if self.cause else ''}"
18 def __repr__(self) -> str:
19 return str(self)
22class CoxbuildRuntimeException(CoxbuildException):
23 """Base exception for runtime errors."""
24 pass
27class CoxbuildSchemaException(CoxbuildException):
28 """Base exception for schema errors."""
29 pass