How to use the @mojaloop/central-services-shared.BaseError function in @mojaloop/central-services-shared

To help you get started, we’ve selected a few @mojaloop/central-services-shared examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mojaloop / central-ledger / src / errors / hubAccountTypeError.js View on Github external
'use strict'

const Shared = require('@mojaloop/central-services-shared')
const BaseError = Shared.BaseError
const ErrorCategory = Shared.ErrorCategory

class HubAccountTypeError extends BaseError {
  constructor (message = 'The requested hub operator account type is not allowed.') {
    super(ErrorCategory.UNPROCESSABLE, message)
  }
}

module.exports = HubAccountTypeError
github mojaloop / central-ledger / src / errors / participantAccountCreate.js View on Github external
'use strict'

const Shared = require('@mojaloop/central-services-shared')
const BaseError = Shared.BaseError
const ErrorCategory = Shared.ErrorCategory

class ParticipantAccountCreateError extends BaseError {
  constructor (message = 'Participant account and Position create have failed.') {
    super(ErrorCategory.UNPROCESSABLE, message)
  }
}

module.exports = ParticipantAccountCreateError
github mojaloop / central-ledger / src / errors / endpointReservedForHubAccountsError.js View on Github external
'use strict'

const Shared = require('@mojaloop/central-services-shared')
const BaseError = Shared.BaseError
const ErrorCategory = Shared.ErrorCategory

class EndpointReservedForHubAccountsError extends BaseError {
  constructor (message = 'Endpoint is reserved for creation of Hub account types only.') {
    super(ErrorCategory.UNPROCESSABLE, message)
  }
}

module.exports = EndpointReservedForHubAccountsError
github mojaloop / central-ledger / src / errors / invalid-body.js View on Github external
'use strict'

const Shared = require('@mojaloop/central-services-shared')

class InvalidBodyError extends Shared.BaseError {
  constructor (message) {
    super(Shared.ErrorCategory.BAD_REQUEST, message)
  }
}

module.exports = InvalidBodyError
github mojaloop / central-ledger / src / errors / record-exists-error.js View on Github external
'use strict'

const Shared = require('@mojaloop/central-services-shared')
const BaseError = Shared.BaseError
const ErrorCategory = Shared.ErrorCategory

class RecordExistsError extends BaseError {
  constructor (message = 'Participant currency has already been registered') {
    super(ErrorCategory.UNPROCESSABLE, message)
  }
}

module.exports = RecordExistsError
github mojaloop / central-ledger / src / errors / unmet-condition.js View on Github external
'use strict'

const Shared = require('@mojaloop/central-services-shared')

class UnmetConditionError extends Shared.BaseError {
  constructor (message = 'Fulfilment does not match any condition') {
    super(Shared.ErrorCategory.UNPROCESSABLE, message)
  }
}

module.exports = UnmetConditionError
github mojaloop / central-ledger / src / errors / hubAccountExists.js View on Github external
'use strict'

const Shared = require('@mojaloop/central-services-shared')
const BaseError = Shared.BaseError
const ErrorCategory = Shared.ErrorCategory

class HubAccountExistsError extends BaseError {
  constructor (message = 'Hub account has already been registered.') {
    super(ErrorCategory.UNPROCESSABLE, message)
  }
}

module.exports = HubAccountExistsError