Skip to content

Commit 619a184

Browse files
committed
exception v internal server error
1 parent ed1915f commit 619a184

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lambdas/shared/src/common/models/errors.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class Code(str, Enum):
1313
forbidden = "forbidden"
1414
not_found = "not-found"
1515
invalid = "invalid or missing access token"
16+
exception = "exception"
1617
server_error = "internal server error"
1718
invariant = "invariant"
1819
incomplete = "parameter-incomplete"
@@ -169,7 +170,7 @@ def to_operation_outcome(self) -> dict:
169170
return create_operation_outcome(
170171
resource_id=str(uuid.uuid4()),
171172
severity=Severity.error,
172-
code=Code.server_error,
173+
code=Code.exception,
173174
diagnostics=self.__str__(),
174175
)
175176

@@ -216,7 +217,7 @@ def to_operation_outcome(self) -> dict:
216217
return create_operation_outcome(
217218
resource_id=str(uuid.uuid4()),
218219
severity=Severity.error,
219-
code=Code.server_error,
220+
code=Code.exception,
220221
diagnostics=self.__str__(),
221222
)
222223

@@ -235,7 +236,7 @@ def to_operation_outcome(self) -> dict:
235236
return create_operation_outcome(
236237
resource_id=str(uuid.uuid4()),
237238
severity=Severity.error,
238-
code=Code.server_error,
239+
code=Code.exception,
239240
diagnostics=self.__str__(),
240241
)
241242

0 commit comments

Comments
 (0)