Skip to content

Commit bd1b7dd

Browse files
authored
Handle BaseFHIRError in handlers
1 parent a5d4914 commit bd1b7dd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

aidbox_python_sdk/handlers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from typing import Any
44

55
from aiohttp import web
6-
from fhirpy.base.exceptions import OperationOutcome
6+
from fhirpy.base.exceptions import OperationOutcome, BaseFHIRError
77

88
from . import app_keys as ak
99

@@ -48,6 +48,8 @@ async def operation(request: web.Request, data: dict[str, Any]):
4848
return result
4949
except OperationOutcome as exc:
5050
return web.json_response(exc.resource, status=422)
51+
except BaseFHIRError as exc:
52+
return web.json_response(str(exc), status=422)
5153

5254

5355
TYPES = {

0 commit comments

Comments
 (0)