Skip to content

Commit ccdcbdc

Browse files
author
Steve Green
committed
Fixed status code of 0
Added es6 true to .eslintrc to allow const
1 parent 45b3d04 commit ccdcbdc

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

.eslintrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ env:
22
browser: true
33
node: true
44
mocha: true
5+
es6: true
56
extends: 'eslint:recommended'
67
rules:
78
indent:

app.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ app.post('/api/message', function (req, res) {
8080
// Send the input to the assistant service
8181
assistant.message(payload, function (err, data) {
8282
if (err) {
83-
return res.status(err.code || 500).json(err);
83+
const status = (err.code !== undefined && err.code > 0)? err.code : 500;
84+
return res.status(status).json(err);
8485
}
8586

8687
return res.json(data);

0 commit comments

Comments
 (0)