Skip to content

Conversation

@nvs119
Copy link
Contributor

@nvs119 nvs119 commented May 8, 2025

Description

Matching on internal code patterns (CAPS_UNDERSCORE_WITH_COLON:) and HTTP codes 400-599 anywhere in the string. Wanted to make this more general but the Indexes page was where I saw the 403 error from filter, so followed it up to the regular-indexes modules.

Screenshot 2025-05-08 at 12 01 03 PM

error without sanitization, in console:
Screenshot 2025-05-08 at 12 08 56 PM

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

@nvs119 nvs119 requested a review from johnjackweir May 8, 2025 16:10
Copy link
Collaborator

@johnjackweir johnjackweir left a comment

Choose a reason for hiding this comment

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

Generally we should have a unit test, especially for tricky things like regexes

I'm ok with this as is while we're trying to get MDE out the door

const httpCodePattern = /\b(4\d{2}|5\d{2})\b/; // Matches HTTP codes 400-599 anywhere in the string

if (internalCodePattern.test(error) || httpCodePattern.test(error)) {
return 'Sorry, an unexpected error has occurred. Try refreshing the page or reporting the issue if it persists.';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nitpick but let's keep it as consistent with ye olde DE as possible

"We're sorry, an unexpected error has occurred. Please try again."

@nbbeeken nbbeeken changed the title (fix): Provide an actionable error message on DE errors CLOUDP-313461 fix: Provide an actionable error message on DE errors CLOUDP-313461 May 8, 2025
@github-actions github-actions bot added the fix label May 8, 2025
@nvs119 nvs119 changed the title fix: Provide an actionable error message on DE errors CLOUDP-313461 (fix) Provide an actionable error message on DE errors CLOUDP-313461 May 8, 2025
@nvs119 nvs119 changed the title (fix) Provide an actionable error message on DE errors CLOUDP-313461 fix(web): Provide an actionable error message on DE errors CLOUDP-313461 May 8, 2025
@nvs119 nvs119 added the no release notes Fix or feature not for release notes label May 8, 2025
@nvs119 nvs119 merged commit 46943b3 into main May 8, 2025
27 of 30 checks passed
@nvs119 nvs119 deleted the CLOUDP-313461 branch May 8, 2025 19:32
@nvs119 nvs119 added release notes and removed no release notes Fix or feature not for release notes labels May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants