Small improvements to AWS-SES-Node

This commit is contained in:
Jan Oberhauser
2020-02-07 14:56:48 -08:00
parent 03c1b0542d
commit 224a51fa56
4 changed files with 94 additions and 159 deletions

View File

@@ -31,9 +31,8 @@ export async function awsApiRequest(this: IHookFunctions | IExecuteFunctions | I
try {
return await this.helpers.request!(options);
} catch (error) {
//console.error(error);
const errorMessage = error.response.body.message || error.response.body.Message || error.message;
const errorMessage = error.response.body.message || error.response.body.Message;
if (error.statusCode === 403) {
if (errorMessage === 'The security token included in the request is invalid.') {
throw new Error('The AWS credentials are not valid!');