Closed Bug 1521972 Opened 5 years ago Closed 5 years ago

Improve JSON.parse error message if data limit is exceeded

Categories

(DevTools :: Netmonitor, defect, P4)

65 Branch
defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1159078

People

(Reporter: ryanmk54, Assigned: thefifthisa, Mentored)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0

Steps to reproduce:

  1. Open the DevTools.
  2. Call a large (11.25 MB) JSON request via AJAX.
  3. Click the request in the Network Panel
  4. Click the Response tab.

Actual results:

It shows
SyntaxError: JSON.parse: unterminated string at line 1 column 1048577 of the JSON data

Expected results:

It should show the formatted JSON

Component: Untriaged → Netmonitor
Product: Firefox → DevTools

There is a limit for storing response bodies set to: 1048576 B

This limit can be changed in a pref.

  1. Load about:config in the URL bar
  2. Search for devtools.netmonitor.responseBodyLimit
  3. Change the value

Does it help?

Honza

Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P4
Flags: needinfo?(ryanmk54)

Yes, this fixes it. As long as the responseBodyLimit is larger than the response size, it works fine. Could the error message be made more intuitive so I know how and where to change this preference? Large response bodies work fine on Chromium browsers. Could the responseBody be increased automatically?

Flags: needinfo?(ryanmk54)

(In reply to ryanmk54 from comment #2)

Yes, this fixes it. As long as the responseBodyLimit is larger than the response size, it works fine. Could the error message be made more intuitive so I know how and where to change this preference? Large response bodies work fine on Chromium browsers. Could the responseBody be increased automatically?

Thanks for the update!

I don't think the limit should be increased automatically (what would be its purpose then?). But, I agree that the message could be more informative and help the user to figure out the real problem and help to increase the limit manually.

(I updated the bug report Summary to cover this).

Honza

Summary: Network panel -> JSON Viewer errors out with large requests → Improve JSON.parse error message if data limit is exceeded

Just to better understand Firefox vs Chrome, what is the purpose in setting a responseBodyLimit? Does it improve performace or prevent browser slowdowns for large responses?

(In reply to ryanmk54 from comment #4)

Just to better understand Firefox vs Chrome, what is the purpose in setting a responseBodyLimit? Does it improve performace or prevent browser slowdowns for large responses?

Correct, it's there to ensure stability (memory/performance)

Honza

(In reply to Jan Honza Odvarko [:Honza] (always need-info? me) from comment #3)

Thanks for the update!

I don't think the limit should be increased automatically (what would be its purpose then?). But, I agree that the message could be more informative and help the user to figure out the real problem and help to increase the limit manually.

(I updated the bug report Summary to cover this).

Honza

Hi Honza! Can I please get assigned to this issue? I'm thinking of updating the error message to "responseBodyLimit exceeded" and maybe adding instructions to let the user know where to change the value. In this case, I don't think it would be classified as a "SyntaxError" on the part of the user. What do you think would be the best label for it?

(In reply to Isabelle Lavandero [:thefifthisa] from comment #6)

Hi Honza! Can I please get assigned to this issue? I'm thinking of updating the error message to "responseBodyLimit exceeded" and maybe adding instructions to let the user know where to change the value. In this case, I don't think it would be classified as a "SyntaxError" on the part of the user. What do you think would be the best label for it?

Thanks for the help, assigned to you!

The message could be something like: "Response body limit exceeded. You might change the default limit in about:config".
(but we can yet reiterate on the exact wording)

Honza

Assignee: nobody → ijlavandero
Mentor: odvarko

Can I be assigned to this issue, as there has been no activity here?
I have a patch ready.

This is actually a duplicate and the UI/UX has been fixed in bug 1159078

Closing.

Honza

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.