mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 20:54:07 -08:00
feat(AWS DynamoDB Node): Improve error handling (#3661)
Co-authored-by: Jan Oberhauser <janober@users.noreply.github.com>
This commit is contained in:
parent
8999403228
commit
ce06d9bb3e
|
@ -59,7 +59,10 @@ export async function awsApiRequest(this: IHookFunctions | IExecuteFunctions | I
|
|||
try {
|
||||
return JSON.parse(await this.helpers.request!(options));
|
||||
} catch (error) {
|
||||
const errorMessage = (error.response && error.response.body && error.response.body.message) || (error.response && error.response.body && error.response.body.Message) || error.message;
|
||||
const errorMessage =
|
||||
(error.response && error.response.body && error.response.body.message) ||
|
||||
(error.response && error.response.body && error.response.body.Message) ||
|
||||
error.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!');
|
||||
|
|
Loading…
Reference in a new issue