Skip to content

Regression - http error codes and message not displayed properly on the UI #8671

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 of 4 tasks
LunaticoCR opened this issue Apr 30, 2025 · 4 comments
Open
2 of 4 tasks
Assignees
Labels
A-ui-ux Area: UI / UX / Design

Comments

@LunaticoCR
Copy link

LunaticoCR commented Apr 30, 2025

Expected Behavior

If an http request fails I expect Insomnia to show the http status code (4xx, 5xx, etc) and the error message in the preview. This used to work but broke recently.

Actual Behavior

When there is a request failure the http status code is not displayed and an internal error message is shown in the preview. The error message is:

message: undefined; stack: Error: message: Cannot read properties of undefined (reading '0'); stack: TypeError: Cannot read properties of undefined (reading '0')
    at fn0 (eval at S (file:///Applications/Insomnia.app/Contents/Resources/app.asar/hiddenBrowserWindow-Ci3kk9w5.js:1:664), <anonymous>:12:21)
    at eval (eval at S (file:///Applications/Insomnia.app/Contents/Resources/app.asar/hiddenBrowserWindow-Ci3kk9w5.js:1:664), <anonymous>:22:13)
    at S (file:///Applications/Insomnia.app/Contents/Resources/app.asar/hiddenBrowserWindow-Ci3kk9w5.js:8:25)
    at async file:///Applications/Insomnia.app/Contents/Resources/app.asar/hiddenBrowserWindow-Ci3kk9w5.js:1:346
    at port.onmessage (/Applications/Insomnia.app/Contents/Resources/app.asar/preload.js:145:18)

Here is a recording of the issue happening when calling an endpoint multiple times until it hits a rate limit (429).

Image

And this screenshots show a 500 that doesn't get properly displayed in preview.

Image Image

Reproduction Steps

Make a request that fails.

Is there an existing issue for this?

Which sync method do you use?

  • Git sync.
  • Insomnia Cloud sync.
  • Local only

Additional Information

This used to work fine a few releases ago.

Insomnia Version

11.0.2

What operating system are you using?

macOS

Operating System Version

Sequoia 15.4.1

Installation method

download

Last Known Working Insomnia version

No response

@LunaticoCR LunaticoCR added B-bug Bug: general classification S-unverified Status: Unverified by maintainer labels Apr 30, 2025
@ihexxa
Copy link
Contributor

ihexxa commented May 6, 2025

Hi @LunaticoCR,
Thanks for the very detailed report, this error message is from scripts.
Please check if there's any part code which accesses the first element of an array while the array is undefined.

@LunaticoCR
Copy link
Author

Yes, eventually after I had opened this ticket I realised that it was from a after-response script, I had duplicated another request that had these.
There was nothing in that error that hinted to me that this came from a script failure. Also, shouldn't request result and script result/error be two separate things? I think there's room for improvement in the UI for this.

@ihexxa
Copy link
Contributor

ihexxa commented May 7, 2025

Probably it tried to make sure user be aware of the error, and yeah we are trying to improve it.

@ihexxa ihexxa added A-ui-ux Area: UI / UX / Design and removed B-bug Bug: general classification S-unverified Status: Unverified by maintainer labels May 7, 2025
@LunaticoCR
Copy link
Author

Yeah, in reality it's more like an unhandled internal error that surfaced to the UI right? I've seen this error even when the underlying http request succeeds with a 200 OK. But this makes it look like it failed for some obscure reason.
It would be ok if this error was shown in the Tests tab in the response panel, but the http response code and body shouldn't be affected by it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ui-ux Area: UI / UX / Design
Projects
None yet
Development

No branches or pull requests

2 participants