Wrong type for lambda.invoke callback's err argument
Describe the bug
Hello,
Am I missing something or the error argument for the invoke's callback should be optional?
Expected Behavior
The type for err to be AWSError | undefined
Current Behavior
The type for err is AWSError
Reproduction Steps
When mocking the invoke function for tests, the type of the callback's error argument will force me to pass an error, when I don't need to.
Possible Solution
No response
Additional Information/Context
No response
SDK version used
master branch
Environment details (OS name and version, etc.)
N/A
Hi @surdu ,
Instead of using callbacks where you are forced to pass in (err, data), you can use async/await.
This should circumvent the need to supply AWSError.
Thanks, Ran~
This issue has not received a response in 1 week. If you still think there is a problem, please leave a comment to avoid the issue from automatically closing.
Thank you for the alternative, but the issue still stands: the err argument should be optional
Hi @surdu ,
We could support this. I'm going to mark this as a feature request.
Thanks, Ran
Hello, this behavior is different in v3 of the SDK. Please migrate to v3, as we are not currently implementing new features in v2.