FIO-7637: add catch block to subform submission loading #5425
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Link to Jira Ticket
https://formio.atlassian.net/browse/FIO-7637
Description
A customer had an urgent production issue - their servers were crashing with unhandled promise exceptions. Upon investigation, the server-side formio.js renderer is attempting to load subform submissions from a baseUrl that is not set, ending in a "Invalid Alias" error. Since Formio.request rejects on 4xx responses, the server will crash because NodeJS expects you to handle uncaught Promise exceptions.
An alternative might have been to examine why Formio.request rejects on 4xx responses rather than delegating handling non network errors to the caller (a lá the fetch web api), but due to the urgency of this ticket for the customer in question and the potential disruption of a change to Formio.request, this seems like the most suitable solution for the moment.
Dependencies
n/a
How has this PR been tested?
n/a
Checklist: