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 2 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 2 commits into
developfrom
ERA-13244-fix-429-error-message

Conversation

@jeslefcourt
Copy link
Copy Markdown
Contributor

@jeslefcourt jeslefcourt commented May 6, 2026

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
Copy link
Copy Markdown
Contributor

@luixlive luixlive left a comment

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

if (error.response?.status?.code) {
switch (error.response.status.code) {
if (error.response?.status) {
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.

Hmm this code has been there for a while. It seems risky to change it suddenly. I just tested an erroneous call on our Open API:
Image

I see the code under status.code. Maybe we need to add some sort of intelligent condition here?

const statusCode = error.response?.status?.code ?? error.response?.status;
switch (statusCode) {

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