Form Builder: Exceptions don't bubble up
If you submit a form that causes the underlying CRUD API to return an error, the error isn't recorded anywhere, displayed on screen, etc. You can replicate this by creating a FB form for an individual and submitting it without entering any values.
The relevant code comment says:
// What to do here? Sometimes we should silently ignore errors, e.g. an optional entity intentionally left blank. Other times it's a real error the user should know about.
But a few lines above, we say:
if (empty($record['fields'])) {
continue;
}
So I'm guessing that comment predates the if
statement, since blank entities shouldn't get saved. So I think we should always be notifying the user.
In addition to showing a message on screen, I think errors should be saved to the AfformSubmission record, that's a killer feature that would make troubleshooting form submission errors in production much easier than Webform.