Rescue Errors on Create Mutation Resolver
What does this MR do and why?
Updates error handling on the create mutation resolver for self-hosted models
Context
Currently, errors aren't being handled correctly by the resolver. If record persistence fails due to invalid params (e.g a non-unique name is supplied), an ActiveRecord rollback of the transaction occurs and errors_on_object()
won't work (model
is nil
after the rollback). This MR updates the logic to rescue the error so that it is surfaced correctly to the client.
This MR is cherry-picked from !159043 (closed) in an effort to split that work up into smaller pieces (the original MR will be closed).
Relates to this issue: #463135 (closed)
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
Related to #463135 (closed)