Display JSON as plain text when encountering errors when parsing

RESOLVED FIXED in Firefox 24

Status

defect
P2
normal
RESOLVED FIXED
6 years ago
Last year

People

(Reporter: vporof, Assigned: vporof)

Tracking

unspecified
Firefox 24
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 1 obsolete attachment)

Sometimes a server may specify a json response content type, but the payload could be malformed. In that case, errors encountered when parsing JSON could be shown in the UI. Right now nothing is displayed (not even the response text!).
Moving into Developer Tools: Netmonitor component. Filter on NETMONITORAMA.
Component: Developer Tools → Developer Tools: Netmonitor
Summary: [netmonitor] Display encountered errors when parsing JSON → Display encountered errors when parsing JSON
Aside from the "Yo, you have an error" message, the response should be shown as plain text in a source editor.
Priority: -- → P2
Summary: Display encountered errors when parsing JSON → Display JSON as plain text when encountering errors when parsing
Posted patch v1 (obsolete) — Splinter Review
Assignee: nobody → vporof
Status: NEW → ASSIGNED
Attachment #759114 - Flags: review?(rcampbell)
Posted patch v2Splinter Review
Forgot to add the "Yo, you have an error" message in the Response tab. Now it's in. Enjoy. It's pretty.
Attachment #759114 - Attachment is obsolete: true
Attachment #759114 - Flags: review?(rcampbell)
Attachment #759138 - Flags: review?(rcampbell)
Posted image looks like this
Comment on attachment 759138 [details] [diff] [review]
v2

Review of attachment 759138 [details] [diff] [review]:
-----------------------------------------------------------------

hot.

::: browser/devtools/netmonitor/netmonitor-view.js
@@ +1647,5 @@
> +          let infoHeader = $("#response-content-info-header");
> +          infoHeader.setAttribute("value", parsingError.message);
> +          infoHeader.setAttribute("tooltiptext", parsingError.toString());
> +          infoHeader.hidden = false;
> +        }

I think I've stared at this long enough.

::: browser/devtools/netmonitor/test/browser_net_json-malformed.js
@@ +63,5 @@
> +          "The mode active in the source editor is incorrect.");
> +
> +        teardown(aMonitor).then(finish);
> +      });
> +    });

yarp!
Attachment #759138 - Flags: review?(rcampbell) → review+
https://hg.mozilla.org/mozilla-central/rev/6f1899c6e4e0
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 24
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.