The VBR returns "internal server errors" for most issues when the view/query fails validation.
I'd like to propagate those errors to the end user.
For example, running the vbr-app locally, if you hit the "get biospecimens" endpoint for a runlist that is empty you see:
Traceback (most recent call last):
File "/Users/urrutia/Documents/TACC/a2cps/vbr/vbr-app/venv/lib/python3.9/site-packages/anyio/streams/memory.py", line 81, in receive
return self.receive_nowait()
File "/Users/urrutia/Documents/TACC/a2cps/vbr/vbr-app/venv/lib/python3.9/site-packages/anyio/streams/memory.py", line 76, in receive_nowait
raise WouldBlock
anyio.WouldBlock
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/urrutia/Documents/TACC/a2cps/vbr/vbr-app/venv/lib/python3.9/site-packages/starlette/middleware/base.py", line 43, in call_next
message = await recv_stream.receive()
File "/Users/urrutia/Documents/TACC/a2cps/vbr/vbr-app/venv/lib/python3.9/site-packages/anyio/streams/memory.py", line 101, in receive
raise EndOfStream
anyio.EndOfStream
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/urrutia/Documents/TACC/a2cps/vbr/vbr-app/venv/lib/python3.9/site-packages/starlette/middleware/errors.py", line 162, in __call__
await self.app(scope, receive, _send)
File "/Users/urrutia/Documents/TACC/a2cps/vbr/vbr-app/venv/lib/python3.9/site-packages/starlette/middleware/base.py", line 68, in __call__
response = await self.dispatch_func(request, call_next)
File "/Users/urrutia/Documents/TACC/a2cps/vbr/vbr-app/./application/main.py", line 133, in add_process_time_header
response = await call_next(request)
File "/Users/urrutia/Documents/TACC/a2cps/vbr/vbr-app/venv/lib/python3.9/site-packages/starlette/middleware/base.py", line 46, in call_next
raise app_exc
File "/Users/urrutia/Documents/TACC/a2cps/vbr/vbr-app/venv/lib/python3.9/site-packages/starlette/middleware/base.py", line 36, in coro
await self.app(scope, request.receive, send_stream.send)
File "/Users/urrutia/Documents/TACC/a2cps/vbr/vbr-app/venv/lib/python3.9/site-packages/starlette/middleware/base.py", line 68, in __call__
response = await self.dispatch_func(request, call_next)
File "/Users/urrutia/Documents/TACC/a2cps/vbr/vbr-app/./application/main.py", line 124, in add_uuid
response = await call_next(request)
File "/Users/urrutia/Documents/TACC/a2cps/vbr/vbr-app/venv/lib/python3.9/site-packages/starlette/middleware/base.py", line 46, in call_next
raise app_exc
File "/Users/urrutia/Documents/TACC/a2cps/vbr/vbr-app/venv/lib/python3.9/site-packages/starlette/middleware/base.py", line 36, in coro
await self.app(scope, request.receive, send_stream.send)
File "/Users/urrutia/Documents/TACC/a2cps/vbr/vbr-app/venv/lib/python3.9/site-packages/starlette/exceptions.py", line 93, in __call__
raise exc
File "/Users/urrutia/Documents/TACC/a2cps/vbr/vbr-app/venv/lib/python3.9/site-packages/starlette/exceptions.py", line 82, in __call__
await self.app(scope, receive, sender)
File "/Users/urrutia/Documents/TACC/a2cps/vbr/vbr-app/venv/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
raise e
File "/Users/urrutia/Documents/TACC/a2cps/vbr/vbr-app/venv/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
await self.app(scope, receive, send)
File "/Users/urrutia/Documents/TACC/a2cps/vbr/vbr-app/venv/lib/python3.9/site-packages/starlette/routing.py", line 670, in __call__
await route.handle(scope, receive, send)
File "/Users/urrutia/Documents/TACC/a2cps/vbr/vbr-app/venv/lib/python3.9/site-packages/starlette/routing.py", line 266, in handle
await self.app(scope, receive, send)
File "/Users/urrutia/Documents/TACC/a2cps/vbr/vbr-app/venv/lib/python3.9/site-packages/starlette/routing.py", line 65, in app
response = await func(request)
File "/Users/urrutia/Documents/TACC/a2cps/vbr/vbr-app/./application/dependencies.py", line 200, in custom_route_handler
response = await original_route_handler(request)
File "/Users/urrutia/Documents/TACC/a2cps/vbr/vbr-app/venv/lib/python3.9/site-packages/fastapi/routing.py", line 235, in app
response_data = await serialize_response(
File "/Users/urrutia/Documents/TACC/a2cps/vbr/vbr-app/venv/lib/python3.9/site-packages/fastapi/routing.py", line 138, in serialize_response
raise ValidationError(errors, field.type_)
pydantic.error_wrappers.ValidationError: 1 validation error for BiospecimenIds
response -> 0 -> biospecimen_id
none is not an allowed value (type=type_error.none.not_allowed)
I'd like pydantic.error_wrappers.ValidationError: 1 validation error for BiospecimenIds to be propagated instead of the internal error
The VBR returns "internal server errors" for most issues when the view/query fails validation.
I'd like to propagate those errors to the end user.
For example, running the vbr-app locally, if you hit the "get biospecimens" endpoint for a runlist that is empty you see:
I'd like
pydantic.error_wrappers.ValidationError: 1 validation error for BiospecimenIds
to be propagated instead of the internal error