Skip to content

fix(alerts): Surface API error messages in create/update toasts#115894

Merged
malwilley merged 1 commit into
masterfrom
malwilley/automation-form-errors
May 20, 2026
Merged

fix(alerts): Surface API error messages in create/update toasts#115894
malwilley merged 1 commit into
masterfrom
malwilley/automation-form-errors

Conversation

@malwilley
Copy link
Copy Markdown
Member

The create and update automation mutation hooks were showing a generic "Unable to create alert" / "Unable to update alert" toast on any API failure, swallowing whatever message the backend actually returned. The detectors hooks already use getWorkflowEngineResponseErrorMessage to extract the first human-readable string from the error response JSON, so this applies the same pattern to useCreateAutomation and useUpdateAutomation.

…oasts

Use getWorkflowEngineResponseErrorMessage to extract structured error
messages from API responses when creating or updating automations,
falling back to the generic message. This matches the pattern already
used in the detectors hooks and the test notification mutation.
@malwilley malwilley requested a review from a team as a code owner May 20, 2026 16:10
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

✅ No new type safety issues introduced. Coverage: 93.56%

Copy link
Copy Markdown
Contributor

@saponifi3d saponifi3d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's goooo

@malwilley malwilley merged commit b52a1e8 into master May 20, 2026
72 checks passed
@malwilley malwilley deleted the malwilley/automation-form-errors branch May 20, 2026 18:12
JonasBa pushed a commit that referenced this pull request May 21, 2026
)

The create and update automation mutation hooks were showing a generic
"Unable to create alert" / "Unable to update alert" toast on any API
failure, swallowing whatever message the backend actually returned. The
detectors hooks already use `getWorkflowEngineResponseErrorMessage` to
extract the first human-readable string from the error response JSON, so
this applies the same pattern to `useCreateAutomation` and
`useUpdateAutomation`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants