bug 1523104: remote: respond with 500 Internal Server Error if unable to serialise JSON; r=ochameau
authorAndreas Tolfsen <ato@sny.no>
Sun, 17 Feb 2019 17:39:19 +0000
changeset 521098 947ad73d45af
parent 521097 65f5581faf6a
child 521099 e3d8a66cdad1
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau
bugs1523104
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 1523104: remote: respond with 500 Internal Server Error if unable to serialise JSON; r=ochameau
remote/Handler.jsm
--- a/remote/Handler.jsm
+++ b/remote/Handler.jsm
@@ -83,12 +83,12 @@ class JSONWriter {
   }
 
   write(data) {
     try {
       const json = JSON.stringify(data, this._replacer, "\t");
       this._response.write(json);
     } catch (e) {
       log.error(`Unable to serialise JSON: ${e.message}`, e);
-      this._response.write("");
+      this._response.setStatusLine("1.1", 500, "Internal Server Error");
     }
   }
 }