mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat(AWS DynamoDB Node): Improve error handling (#3661)
Co-authored-by: Jan Oberhauser <janober@users.noreply.github.com>
This commit is contained in:
@@ -59,7 +59,10 @@ export async function awsApiRequest(this: IHookFunctions | IExecuteFunctions | I
|
|||||||
try {
|
try {
|
||||||
return JSON.parse(await this.helpers.request!(options));
|
return JSON.parse(await this.helpers.request!(options));
|
||||||
} catch (error) {
|
} 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 (error.statusCode === 403) {
|
||||||
if (errorMessage === 'The security token included in the request is invalid.') {
|
if (errorMessage === 'The security token included in the request is invalid.') {
|
||||||
throw new Error('The AWS credentials are not valid!');
|
throw new Error('The AWS credentials are not valid!');
|
||||||
|
|||||||
Reference in New Issue
Block a user