When the preview does not succeed (eg: mapping error), an exception is raised.
for instance:
fhir-river_river-api.1.uxaqfub11ltl@sandbox1 | File "./river/extractor/query_builder.py", line 211, in get_column
fhir-river_river-api.1.uxaqfub11ltl@sandbox1 | raise ImproperMappingError(f"Column '{column.column}' not found in table '{column.table}'.")
fhir-river_river-api.1.uxaqfub11ltl@sandbox1 | river.extractor.errors.ImproperMappingError: Column 'patient_deathdate' not found in table 'osiris_patient'.
The issue is that this issue (and probably many others) are never catched thus resulting in a 500 response by the API (default django response when an exception occurs). Now that the front is ready to properly display API errors, it would be greatly appreciated to have more details than just "500 - internal server error".
Reproduction
create a mapping with an error
try a preview
see river-api logs (you should see the exception)
Resolution
I guess that we want to have a try/except block at the top level in order to catch all exceptions and format a "400 - bad request" exception with the content of the exception as body.
Description
When the preview does not succeed (eg: mapping error), an exception is raised. for instance:
The issue is that this issue (and probably many others) are never catched thus resulting in a 500 response by the API (default django response when an exception occurs). Now that the front is ready to properly display API errors, it would be greatly appreciated to have more details than just "500 - internal server error".
Reproduction
Resolution