Skip to content

Commit

Permalink
Fix error callback for expired transfers (#785)
Browse files Browse the repository at this point in the history
  • Loading branch information
oderayi authored Sep 22, 2020
1 parent 3f8cfd0 commit b577761
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 62 deletions.
117 changes: 61 additions & 56 deletions package-lock.json

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

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mojaloop/central-ledger",
"version": "11.2.0",
"version": "11.2.1",
"description": "Central ledger hosted by a scheme to record and settle transfers",
"license": "Apache-2.0",
"author": "ModusBox",
Expand Down Expand Up @@ -86,7 +86,7 @@
"@mojaloop/central-services-health": "10.6.0",
"@mojaloop/central-services-logger": "10.6.0",
"@mojaloop/central-services-metrics": "9.5.0",
"@mojaloop/central-services-shared": "11.3.3",
"@mojaloop/central-services-shared": "11.3.5",
"@mojaloop/central-services-stream": "10.6.0",
"@mojaloop/event-sdk": "10.6.0",
"@mojaloop/forensic-logging-client": "8.3.0",
Expand All @@ -108,8 +108,8 @@
"ilp-packet": "2.2.0",
"knex": "0.21.5",
"lodash": "4.17.20",
"moment": "2.27.0",
"mongoose": "5.10.3",
"moment": "2.29.0",
"mongoose": "5.10.6",
"npm-run-all": "4.1.5",
"rc": "1.2.8",
"require-glob": "3.2.0",
Expand All @@ -122,11 +122,11 @@
"async-retry": "1.3.1",
"faucet": "0.0.1",
"get-port": "5.1.1",
"jsdoc": "3.6.5",
"jsdoc": "3.6.6",
"jsonpath": "1.0.2",
"nodemon": "2.0.4",
"npm-audit-resolver": "2.2.1",
"npm-check-updates": "8.1.1",
"npm-check-updates": "9.0.1",
"nyc": "15.1.0",
"pre-commit": "1.2.2",
"proxyquire": "2.1.3",
Expand Down
7 changes: 7 additions & 0 deletions src/handlers/transfers/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,13 @@ const getTransfer = async (error, messages) => {
await Kafka.proceed(Config.KAFKA_CONFIG, params, { consumerCommit, fspiopError: fspiopError.toApiErrorObject(Config.ERROR_HANDLING), eventDetail, fromSwitch })
throw fspiopError
}
if (transfer.transferState === Enum.Transfers.TransferInternalState.EXPIRED_RESERVED) {
Logger.isInfoEnabled && Logger.info(Util.breadcrumb(location, `callbackTransferExpired--${actionLetter}3`))
const fspiopError = ErrorHandler.Factory.createFSPIOPError(ErrorHandler.Enums.FSPIOPErrorCodes.TRANSFER_EXPIRED)
await Kafka.proceed(Config.KAFKA_CONFIG, params, { consumerCommit, fspiopError: fspiopError.toApiErrorObject(Config.ERROR_HANDLING), eventDetail, fromSwitch })
throw fspiopError
}

// ============================================================================================
Util.breadcrumb(location, { path: 'validationPassed' })
Logger.isInfoEnabled && Logger.info(Util.breadcrumb(location, `callbackMessage--${actionLetter}4`))
Expand Down

0 comments on commit b577761

Please sign in to comment.