Minor fix to Mailchimp-Node

This commit is contained in:
Jan Oberhauser 2020-05-22 21:44:39 +02:00
parent 194d2bdacd
commit c03a7d12a1

View file

@ -45,9 +45,9 @@ export async function mailchimpApiRequest(this: IHookFunctions | IExecuteFunctio
return await this.helpers.request!(options);
} catch (error) {
if (error.response.body && error.response.body.detail) {
throw new Error(`Mailchimp Error: response [${error.statusCode}]: ${error.response.body.detail}`);
throw new Error(`Mailchimp Error response [${error.statusCode}]: ${error.response.body.detail}`);
}
throw new Error(error);
throw error;
}
}