Skip to content

Commit

Permalink
Merge pull request #114 from oddnetworks/json-api-bugfixes
Browse files Browse the repository at this point in the history
Json api bugfixes
  • Loading branch information
kixxauth authored Jul 17, 2016
2 parents 6def2da + 86119d2 commit 0d74f99
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/middleware/error-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ module.exports = function (options) {
function formatError(error) {
const output = error.output || {};
return {
status: output.statusCode ? output.statusCode.toString() : null,
title: error.name,
detail: error.message
status: output.statusCode ? output.statusCode.toString() : '500',
title: output.payload ? output.payload.error : error.name,
detail: output.payload ? output.payload.message : (error.message || error.toString())
};
}

Expand Down
2 changes: 1 addition & 1 deletion lib/middleware/response-json-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ module.exports = function (options) {
defaultPort = true;
}

if (defaultPort) {
if (!defaultPort) {
baseUrl = `${baseUrl}:${port}`;
}
if (BASE_PREFIX) {
Expand Down

0 comments on commit 0d74f99

Please sign in to comment.