Display server error after solid-form submission
What needs to be done?
When I use <solid-form>
I can add some fields to make browser-side validation before submitting. But if an error occurs on the server (for example an error "400 Bad request" is returned) this is not shown to the end-user. The form is just cleared without any message displayed.
Technical details
The error sent back by the server contains all the relevant data :
{
"name":[
"Ensure this field has no more than 150 characters."
],
"@context":"https://cdn.happy-dev.fr/owl/hdcontext.jsonld"
}
Here, the error is related to the "name" field.
How to complete
- How to complete a Feature
- Ask any question you have in the issue comments before starting
- Create a new branch named ${ISSUE_NUMBER}-issue-name
- Implement a simple test to illustrate the desired functionality
- Write some code to complete this task
- Write some additional tests to cover edge cases and some possible errors
- Write documentation about what have you done and why you have done it this way
- Submit a merge request