Refactor middleware code which returns empty results to signal failure to instead throw exceptions to be handled #336
Labels
fixed_in_dev
This is merged into the dev environment and waiting to be merged into main
refactor
Improve the code without changing the underlying logic
At several parts of the code, empty results are returned in the case of failure, which is then handled in subsequent code. For example, in
data_source_by_id_query
inmiddleware/data_source_queries.py
:And then in
data_source_by_id_wrapper
, which calls this:Code like this poses a few problems:
Thus, in cases like this in the code where an empty value is returned to signal failure, a custom exception should instead be thrown, which is then handled in functions calling it.
The text was updated successfully, but these errors were encountered: