- Docs
- Data Control Platform
- SDKs
- NodeJS
- SDKError
SDKError
The SDKError
class represents an extended JavaScript Error
class that is returned upon failure for all IronNode SDKs that return Promises. This custom error class has the same properties as the normal JavaScript Error
class but also exposes a code
property that represents one of the unique Error Codes that can occur.
Properties
Property | Value | Description |
---|---|---|
message | string | Readable error message. |
code | number | Numerical error code that represents a unique Error Code for the operation that failed. |
rawError | Error | Original, unaltered JavaScript Error instance that this custom Error class wrapped. |
Example
JavaScriptSDK.document.decryptFromStore('323') .then(() => {}) .catch((error) => { //The 'error' variable is an instance of an SDKError if(error.code === IronNode.ErrorCodes.DOCUMENT_DECRYPT_FAILURE){...} })