ts2asl
ts2asl copied to clipboard
validate property access to caught errors
typescript errors that get thrown can be caught.
in typescript the type that gets caught is an instance of the error.
in ASL the type that gets "caught" is a structure that looks like {Error?: string, Cause?: string}
.
would be good to both:
- create a
asl.error(error, cause)
function that return an instance of an AslError - have the
asl.error(error, cause)
function also ensure the error is set to the name of the Node Error. this will ensure errors in lambda functions are correctly caught - validate member access of the caught variable. e.g. error.something would throw even though that field exists in typescript.