Skip to content

Commit

Permalink
added error code
Browse files Browse the repository at this point in the history
  • Loading branch information
shashi165 committed Jan 16, 2020
1 parent f6e8f6c commit 53f4907
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 38 deletions.
47 changes: 14 additions & 33 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"rc": "1.2.8"
},
"devDependencies": {
"@types/jest": "^24.0.23",
"@types/jest": "^24.9.0",
"eslint": "6.7.2",
"jest": "24.9.0",
"jest-junit": "10.0.0",
Expand Down
7 changes: 3 additions & 4 deletions src/model/quotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -833,16 +833,15 @@ class QuotesModel {
MojaloopApiErrorCodes.PAYEE_UNSUPPORTED_CURRENCY.code,
MojaloopApiErrorCodes.PAYER_ERROR.code,
MojaloopApiErrorCodes.PAYER_UNSUPPORTED_CURRENCY.code
];
]
if (error.name === 'FSPIOPError' && syncErrorCodes.includes(error.apiErrorCode.code)) {
// We should respond synchronously
const envConfig = new Config()
return {
body: error.toApiErrorObject(envConfig.errorHandling),
code: ENUM.Http.ReturnCodes.BADREQUEST
code: ENUM.Http.ReturnCodes.BADREQUEST.CODE
}
}
else {
} else {
// We should respond asynchronously
await this.sendErrorCallback(fspiopSource, fspiopError, quoteId, headers, childSpan)
return {
Expand Down

0 comments on commit 53f4907

Please sign in to comment.