Closed tcompa closed 1 week ago
An example of what could be improved:
An example where this is already handled:
Some explanation about error handling @ 0c473b29be6d0b86d3429e6c35c290f52bec2b7f
Errors that have been improved by the refactoring:
That looks great! If we can move all our errors to such a display, that's a great win! :)
This will be closed with #542. Let's open other issues in case error messages for payload fields are not clear or not well formatted.
They are very nested by default, but the relevant information can be displayed in a simpler way - see https://github.com/fractal-analytics-platform/fractal-web/pull/310#issuecomment-1754739886 and https://github.com/fractal-analytics-platform/fractal-client/issues/548#issuecomment-1733382438.
https://github.com/fractal-analytics-platform/fractal-web/pull/310/commits/af390602f1cbd894cdf3f6a768a6d59a02f205a4 introduces
getSimpleValidationMessage
, where we check by hand that the error structure matches with a known one. For any deviation from this given structure (e.g. because there are multiple validation errors, or because future fastapi/pydantic versions change this structure) we should always return the original message, but when there is a matching structure we can make it more readable.