formio.js icon indicating copy to clipboard operation
formio.js copied to clipboard

Fix and cleanup form submission api error handling

Open hschletz opened this issue 2 years ago • 0 comments

When the form submission request results in a 4xx or 5xx response, showErrors() is invoked with a message string. This is no longer supported and results in an exception, causing script abortion without any feedback to the user.

This PR removes the showErrors() call as it seems to be a leftover from a previous implementation that supported string arguments. The message is still displayed via setAlert().

I also cleaned up the error handling code by deduplicating the message composition code.

hschletz avatar Aug 28 '22 16:08 hschletz