Skip to content

Commit

Permalink
feat: add new error message of response
Browse files Browse the repository at this point in the history
- add not supported media type error message
- add bad request error message
  • Loading branch information
Chinlinlee committed May 12, 2022
1 parent 6179073 commit 30d9586
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions utils/errorResponse/errorResponseMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,26 @@ function getInternalServerErrorMessage(details) {
return message;
}

function getNotSupportedErrorMessage(details) {
let message = {
Details: details,
HttpStatus: 406,
Message: "Media type not supported",
Method: "GET"
};
return message;
}

function getBadRequestErrorMessage(details) {
let message = {
Details: details,
HttpStatus: 400,
Message: "Bad request",
Method: "GET"
};
return message;
}

module.exports.getInternalServerErrorMessage = getInternalServerErrorMessage;
module.exports.getNotSupportedErrorMessage = getNotSupportedErrorMessage;
module.exports.getBadRequestErrorMessage = getBadRequestErrorMessage;

0 comments on commit 30d9586

Please sign in to comment.