Skip to content

Error toasts: show HTTP response detail + don't auto-close#235

Merged
TimCsaky merged 1 commit intomasterfrom
feature/toast-error-details
May 5, 2025
Merged

Error toasts: show HTTP response detail + don't auto-close#235
TimCsaky merged 1 commit intomasterfrom
feature/toast-error-details

Conversation

@norrisng-bc
Copy link
Contributor

Description

The detailed COMS error response message (specifically, the detail field) is now displayed in the toast body instead. Previously, only the HTTP response code and a generic AxiosError message is displayed.

Example: updating a bucket using invalid S3 credentials

Before:

Error: Configuring storage location source
AxiosError: Request failed with status code 409

After:

Error: Configuring storage location source
Unable to validate supplied credentials for the bucket

Also, error notifications no longer disappear automatically; they must be closed manually instead.

This should make it easier for users to diagnose basic errors, without having to reach out to us every time.

SHOWCASE-3941

Types of changes

New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING doc
  • I have checked that unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

error.response?.data.detail ?? error

If the error isn't coming from the COMS API (or if COMS fails to return a properly-formatted error response as per the API spec), the toast message will fallback to the raw error itself, as was the case previously.

@github-actions
Copy link

github-actions bot commented May 1, 2025

Coverage Report (Application)

Totals Coverage
Statements: 70.67% ( 53 / 75 )
Methods: 62.5% ( 5 / 8 )
Lines: 81.63% ( 40 / 49 )
Branches: 44.44% ( 8 / 18 )

@norrisng-bc norrisng-bc force-pushed the feature/toast-error-details branch from dffd300 to e0a7e58 Compare May 2, 2025 00:23
@norrisng-bc norrisng-bc force-pushed the feature/toast-error-details branch from e0a7e58 to 222ad66 Compare May 2, 2025 00:30
@github-actions
Copy link

github-actions bot commented May 2, 2025

Coverage Report (Frontend)

Totals Coverage
Statements: 17% ( 810 / 4764 )
Methods: 17.33% ( 152 / 877 )
Lines: 20.8% ( 549 / 2640 )
Branches: 8.74% ( 109 / 1247 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants