Closed Bug 859055 Opened 8 years ago Closed 8 years ago

Display JSON as plain text when encountering errors when parsing

Categories

(DevTools :: Netmonitor, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 24

People

(Reporter: vporof, Assigned: vporof)

Details

Attachments

(2 files, 1 obsolete file)

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
Attached patch v1 (obsolete) — Splinter Review
Assignee: nobody → vporof
Status: NEW → ASSIGNED
Attachment #759114 - Flags: review?(rcampbell)
Attached 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)
Attached 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: 8 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.