Improve JSON.parse error message if data limit is exceeded
Categories
(DevTools :: Netmonitor, defect, P4)
Tracking
(Not tracked)
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:
- Open the DevTools.
- Call a large (11.25 MB) JSON request via AJAX.
- Click the request in the Network Panel
- 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
Updated•5 years ago
|
Comment 1•5 years ago
|
||
There is a limit for storing response bodies set to: 1048576 B
This limit can be changed in a pref.
- Load
about:config
in the URL bar - Search for
devtools.netmonitor.responseBodyLimit
- Change the value
Does it help?
Honza
Updated•5 years ago
|
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?
Comment 3•5 years ago
|
||
(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
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?
Comment 5•5 years ago
|
||
(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
Assignee | ||
Comment 6•5 years ago
|
||
(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?
Comment 7•5 years ago
|
||
(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
Can I be assigned to this issue, as there has been no activity here?
I have a patch ready.
Comment 9•5 years ago
|
||
Description
•