Skip to content
This repository has been archived by the owner on May 1, 2023. It is now read-only.

Commit

Permalink
fix(api): use message in code property
Browse files Browse the repository at this point in the history
If there is any error and code is empty, set code equals to message.
  • Loading branch information
albertosantini committed May 3, 2017
1 parent d0e7288 commit 5ece339
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server/routes/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,13 +407,13 @@ function processApiError(apiName, err, code, message, res) {
if (err) {
util.log("ERROR", apiName, err);
res.json({
code: "",
code: err,
message: err
});
} else {
util.log("ERROR", apiName, code, message);
res.json({
code,
code: code || message,
message
});
}
Expand Down

0 comments on commit 5ece339

Please sign in to comment.