Skip to content

ERA-13244: Fix HTTP errors showing "unknown error" instead of human-readable message on event submit#1561

Open
jeslefcourt wants to merge 5 commits into
developfrom
ERA-13244-fix-429-error-message
Open

ERA-13244: Fix HTTP errors showing "unknown error" instead of human-readable message on event submit#1561
jeslefcourt wants to merge 5 commits into
developfrom
ERA-13244-fix-429-error-message

Conversation

@jeslefcourt

@jeslefcourt jeslefcourt commented May 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fixes generateErrorMessageForRequest in src/utils/request.js which was checking error.response?.status?.code — Axios puts the HTTP status code at error.response.status (a number), so .code was always undefined and the switch never matched any case
  • Updates generateErrorListForApiResponseDetails catch block in ReportDetailView to call generateErrorMessageForRequest instead of always falling back to "unknown error"
  • A 429 on event submit now shows: "Too many requests. Please try again later, and contact your administrator if this problem persists (429)."

Test plan

  • Submit an event while rate-limited (HTTP 429) and verify the human-readable message appears
  • Verify other HTTP error codes (400, 403, 500, etc.) also show their localized messages
  • Verify that structured API error detail responses still parse and display correctly
  • Verify the event feed error path (FEED_FETCH_ERROR) still works correctly

Jira: ERA-13244

🤖 Generated with Claude Code

jeslefcourt and others added 2 commits May 6, 2026 13:44
…-13244)

Fixes generateErrorMessageForRequest checking error.response?.status?.code
(always undefined on an Axios number status) instead of error.response?.status,
and updates the ReportDetailView error catch block to use it so 429 and other
HTTP errors show their localized message instead of "unknown error".

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…Details

generateErrorMessageForRequest crashes when called with undefined (e.g. when
Promise.reject() is called with no value). Guard with a null check before
calling it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jeslefcourt jeslefcourt requested a review from luixlive May 6, 2026 21:19

@luixlive luixlive left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Trivial and sound. I just think we need to double check if that change in generateErrorMessageForRequest is correct.

Comment thread src/utils/request.js Outdated
jeslefcourt and others added 3 commits June 15, 2026 10:05
… surfaces

generateErrorMessageForRequest checked error.request before the
error.response.status switch. Axios errors that received an HTTP response
(e.g. 429) carry both .request and .response, so the early return short-
circuited to 'noResponse' and the status switch — including case 429 — was
never reached. Reorder response-status first, then the no-response check.

Add request.test.js (covers 429, other statuses, no-response, the both-set
axios shape, and no-code) and a ReportDetailView test for the catch path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Address review feedback (luixlive): the status code may live at
error.response.data.status.code (DAS error body), error.response.status.code
(status object), or error.response.status (numeric HTTP status). Read all
three with body-first precedence so the human-readable message (e.g. 429
"too many requests") surfaces regardless of shape.

Expand request.test.js to 11 cases covering each shape plus body-code
precedence over numeric status.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…error-message

# Conflicts:
#	src/ReportManager/ReportDetailView/index.js
@jeslefcourt jeslefcourt requested a review from luixlive June 15, 2026 17:41
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