Error handling
The application throws nested errors, ranging from functional to technical.
Example of an invalid KAS credential error during decryption:
bash
W [SdsdkError]: ZTDF decryption failed
at W.createWithCandidateCauseError (file:///home/***/node_modules/sdsdk/dist/sdsdk.mjs:1:21769)
at ca (file:///home/***/node_modules/sdsdk/dist/sdsdk.mjs:14:72662)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async file:///home/***/decrypt.js:30:22 {
cause: n [Error]: fetching error
at Hn.queryWithApiKeyCredentials (file:///home/***/node_modules/sdsdk/dist/sdsdk.mjs:7:23269)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async re.decryptDek (file:///home/***/node_modules/sdsdk/dist/sdsdk.mjs:1:24217)
... 2 lines matching cause stack trace ...
at async file:///home/***/decrypt.js:30:22 {
cause: Bn [HttpError]: HTTP Error 401: Unauthorized - {"code":401,"message":"Decrypt route call failed. Please contact your administrator.","details":"2001021,2006003,1014001,2005006"}
at Hn.sendRequest (file:///home/***/node_modules/sdsdk/dist/sdsdk.mjs:7:24708)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async Hn.queryWithApiKeyCredentials (file:///home/***/node_modules/sdsdk/dist/sdsdk.mjs:7:23205)
at async re.decryptDek (file:///home/***/node_modules/sdsdk/dist/sdsdk.mjs:1:24217)
at async se.execute (file:///home/***/node_modules/sdsdk/dist/sdsdk.mjs:1:25127)
at async ca (file:///home/***/node_modules/sdsdk/dist/sdsdk.mjs:14:72469)
at async file:///home/***/decrypt.js:30:22 {
status: 401,
statusText: 'Unauthorized',
body: '{"code":401,"message":"Decrypt route call failed. Please contact your administrator.","details":"2001021,2006003,1014001,2005006"}'
}
}
}