Open Ahlaee opened 10 months ago
Hello there,
I encountered an error handling issue when emitting custom errors inside executeLambda. The following pseudo code will create a TypeError:
try { await qldbDriver.executeLambda(async (txn) => { ... throw new CustomError ... ... }); } catch(error) { console.log(error); }
-> TypeError: Right-hand side of 'instanceof' is not an object
If the error is thrown outside executeLambda it works the usual way:
try { throw new CustomError ... await qldbDriver.executeLambda(async (txn) => { ... }); } catch(error) { console.log(error); }
-> e [Error]: CustomError ...
Is there something obvious I'm missing regarding emitting errors inside executeLambda? Should I consider error handling always outside of executeLambda? Would you need more context?
Thank you for your help!
Using:
tsc 5.2.2 "@aws-sdk/client-qldb": "^3.445.0", "amazon-qldb-driver-nodejs": "^3.0.1" "serverless": "^3.36.0", "serverless-bundle": "^6.0.0"
Running on AWS Lambda with node.js v18.x
I have just tested the same stated versions but can not reproduce. You have any stack trace?
"@aws-sdk/client-qldb": "3.445.0", "amazon-qldb-driver-nodejs": "3.0.1",
Hello there,
I encountered an error handling issue when emitting custom errors inside executeLambda. The following pseudo code will create a TypeError:
-> TypeError: Right-hand side of 'instanceof' is not an object
If the error is thrown outside executeLambda it works the usual way:
-> e [Error]: CustomError ...
Is there something obvious I'm missing regarding emitting errors inside executeLambda? Should I consider error handling always outside of executeLambda? Would you need more context?
Thank you for your help!
Using:
tsc 5.2.2 "@aws-sdk/client-qldb": "^3.445.0", "amazon-qldb-driver-nodejs": "^3.0.1" "serverless": "^3.36.0", "serverless-bundle": "^6.0.0"
Running on AWS Lambda with node.js v18.x