Skip to content

Commit

Permalink
fix issues where error object extensionList is getting returned as an…
Browse files Browse the repository at this point in the history
… array (#208)
  • Loading branch information
rmothilal authored Aug 31, 2020
1 parent 984ca0d commit ec885ac
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 57 deletions.
125 changes: 74 additions & 51 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sims",
"version": "11.0.0",
"version": "11.0.1",
"description": "A super-simple fsp simulator",
"main": "src/index.js",
"author": "ModusBox",
Expand Down Expand Up @@ -42,7 +42,7 @@
"@mojaloop/central-services-error-handling": "10.6.0",
"@mojaloop/central-services-logger": "10.6.0",
"@mojaloop/central-services-metrics": "9.5.0",
"@mojaloop/central-services-shared": "11.1.4",
"@mojaloop/central-services-shared": "11.2.0",
"@mojaloop/sdk-standard-components": "10.3.2",
"axios": "0.20.0",
"base64url": "3.0.1",
Expand All @@ -57,6 +57,6 @@
"pre-commit": "1.2.2",
"standard": "14.3.4",
"npm-audit-resolver": "2.2.1",
"npm-check-updates": "7.1.1"
"npm-check-updates": "8.0.1"
}
}
6 changes: 3 additions & 3 deletions src/oracle/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ exports.delParticipantsByTypeId = function (request, h) {
errorDescription: `ID:${request.params.ID} not found`
}
histTimerEnd({ success: false, operation: 'deleteParticipants', source: request.headers['fspiop-source'], destination: request.headers['fspiop-destination'] })
return h.response(buildErrorObject(errorObject, [])).code(400)
return h.response(buildErrorObject(errorObject, { extension: [] })).code(400)
}
} else {
throw new Error(`Type:${request.params.Type} not found`)
Expand All @@ -185,7 +185,7 @@ exports.createParticipantsBatch = function (request, h) {
errorCode: 2345,
errorDescription: `Duplicated batch requestId:${request.payload.requestId} received`
}
return h.response(buildErrorObject(errorObject, [])).code(400)
return h.response(buildErrorObject(errorObject, { extension: [] })).code(400)
} else {
const newRequest = {
headers: request.headers,
Expand Down Expand Up @@ -221,7 +221,7 @@ exports.createParticipantsBatch = function (request, h) {
errorCode: 1234,
errorDescription: `Participant:${party.partyIdentifier} already exists`
}
errorInformation = buildErrorObject(errorObject, [{ key: party.partyIdentifier, value: party.partyIdType }])
errorInformation = buildErrorObject(errorObject, { extension: [{ key: party.partyIdentifier, value: party.partyIdType }] })
responseObject.partyList.push({ partyId, errorInformation })
} else {
idMap.set(party.partyIdentifier, record)
Expand Down

0 comments on commit ec885ac

Please sign in to comment.