diff options
author | Takuya Yoshida <hawaiianphoto@geekhost.net> | 2017-06-24 02:22:02 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-06-23 19:22:02 +0200 |
commit | 0c44316b22c3711ad5369dae2f66f0fd5c79799e (patch) | |
tree | 4a5d30d5c6f3df88cc3cd3cd5374540313398df2 | |
parent | 2211e8d1cd6eb97a8a04e24c1fea7031a201edb5 (diff) |
Fix errorMiddleware to prevent "TypeError: res.writeHead is not a function" (#3913)
* Fix errorMiddleware * Add "eslint-disable-line no-unused-vars"
-rw-r--r-- | streaming/index.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/streaming/index.js b/streaming/index.js index fb23be34d..156e1d4bc 100644 --- a/streaming/index.js +++ b/streaming/index.js @@ -242,7 +242,7 @@ const startWorker = (workerId) => { accountFromRequest(req, next); }; - const errorMiddleware = (err, req, res) => { + const errorMiddleware = (err, req, res, next) => { // eslint-disable-line no-unused-vars log.error(req.requestId, err.toString()); res.writeHead(err.statusCode || 500, { 'Content-Type': 'application/json' }); res.end(JSON.stringify({ error: err.statusCode ? err.toString() : 'An unexpected error occurred' })); |