@gala-chain/chaincode ∙ API
API > DuplicateInvokeChaincodeError
Class: DuplicateInvokeChaincodeError
Contents
- Extends
- Constructors
- new DuplicateInvokeChaincodeError(chaincodeName, args, channel)
- Properties
- code
- key
- message
- name
- payload
- stack
- Methods
- andExec()
- logError()
- logWarn()
- map()
- matches()
Extends
NotImplementedError
Constructors
new DuplicateInvokeChaincodeError(chaincodeName, args, channel)
new DuplicateInvokeChaincodeError(
chaincodeName,args,channel):DuplicateInvokeChaincodeError
Parameters
▪ chaincodeName: string
▪ args: string[]
▪ channel: string
Overrides
NotImplementedError.constructor
Source
chaincode/src/types/GalaChainStub.ts:213
Properties
code
readonlycode:ErrorCode
Status code, a value from ErrorCode enum. It is directly mapped to HTTP, status, it is a constant value to be used by clients integrating with the chain.
Inherited from
NotImplementedError.code
Source
chain-api/src/utils/error.ts:46
key
readonlykey:Uppercase\<string>
An upper case string to be used as a key do diagnose where the error comes from and help with regular development. It should not be used by client integrating with the chain since we don't guarantee it won't change. It is generated from original error class name.
Inherited from
NotImplementedError.key
Source
chain-api/src/utils/error.ts:54
message
message:
string
Inherited from
NotImplementedError.message
Source
node_modules/typescript/lib/lib.es5.d.ts:1076
name
name:
string
Inherited from
NotImplementedError.name
Source
node_modules/typescript/lib/lib.es5.d.ts:1075
payload
readonlypayload?:Record\<string,unknown>
Additional information to be used by
Inherited from
NotImplementedError.payload
Source
chain-api/src/utils/error.ts:59
stack
stack?:
string
Inherited from
NotImplementedError.stack
Source
node_modules/typescript/lib/lib.es5.d.ts:1077
Methods
andExec()
andExec(
fn):ChainError
Allows to execute function getting as a parameter the current error.
Parameters
▪ fn: (e) => void
Returns
Inherited from
NotImplementedError.andExec
Example
Source
chain-api/src/utils/error.ts:115
logError()
logError(
logger):ChainError
Parameters
▪ logger: object
▪ logger.error
Inherited from
NotImplementedError.logError
Source
chain-api/src/utils/error.ts:120
logWarn()
logWarn(
logger):ChainError
Parameters
▪ logger: object
▪ logger.warn
Inherited from
NotImplementedError.logWarn
Source
chain-api/src/utils/error.ts:125
map()
map(
key,newError):ChainError
Maps ChainError to another chain error by error code if key param matches
current error code or current diagnostic key. Otherwise, returns original
error.
Useful in rethrowing an error or mapping an error to another one in catch clauses or catch methods in promises.
Parameters
▪ key: ErrorCode | ClassConstructor\<ChainError>
error code or error class to match
▪ newError: ChainError | (e) => ChainError
new error or a function to create the new error
Inherited from
NotImplementedError.map
Source
chain-api/src/utils/error.ts:149
matches()
matches(
key):boolean
Parameters
▪ key: ErrorCode | ClassConstructor\<ChainError>
Inherited from
NotImplementedError.matches