Open nathanielks opened 7 years ago
Here's what I've tried thus far:
AWS.mock('ECS', 'updateContainerInstancesState', (params) => {
console.log(params)
const err = 'boogers'
return new Error(err)
})
AWS.mock('ECS', 'updateContainerInstancesState', (params) => {
console.log(params)
const err = 'boogers'
throw new Error(err)
})
Hi nathanielelks.
I was able to get this to work:
AWS.mock('DynamoDB.DocumentClient', 'put', function(params, callback) {
callback(new Error(), null);
});
We recently upgraded from 5.5.0
to 5.9.0
and new Error()
does not seem to work anymore:
Overload 1 of 2, '(err: undefined, data: InvocationResponse): void', gave the following error.
Argument of type 'Error' is not assignable to parameter of type 'undefined'.
Overload 2 of 2, '(err: AWSError, data?: undefined): void', gave the following error.
Argument of type 'Error' is not assignable to parameter of type 'AWSError'.
652 callback(error, params);
Hiya, team!
Great job on the package, thanks for making this! I'm trying to figure out how I would simulate service throwing an error and I can't quite figure out how. Could you shed some light on the situation? Thank you!