Correct sfs responses when (an) error(s) occur(s)
When sfs indexes dataflows, it might encounter issues. Even though the dataflow(s) might be indexed successfully, sfs might still return "404 Not Found", because the response of the call is "in series", the response representing the latest action of the search:
In the logs, we see the success and the error:
Since this is misleading the user in the DLM (who might not even go to the details in DLM LogBook in the hope that the dataflow was still indexed), the return code should instead be:
- 207 (Multi-Status) if the dataflow could be re-indexed but may not for all defined data sources or other additional errors
- 409 Conflict if the dataflow could not be indexed because it was not categorised
- 500 Internal Server Error if the dataflow could not be indexed due to an internal error, like a configuration error.
The error message in the body in these cases should then also be clearer. Instead of
{
"message": "Response code 404 (Not Found)"
}
it should be:
{
"message": "Cannot load 'https://sdmx.oecd.org/public/rest/categoryscheme/SDMX/STAT_SUBJECT_MATTER/1.0/?references=dataflow'",
}
To allow testing this a wrong categoryscheme was added in the QA sfs config (see here). Once this ticket is successfully implemented and tested this config can be removed.