Fixed Contentful error parsing, added missing comma in entryDescription

This commit is contained in:
Rupenieks 2020-08-28 16:28:02 +02:00
parent 198cd6258c
commit 322b94255a
2 changed files with 2 additions and 12 deletions

View file

@ -200,7 +200,7 @@ export const fields = [
],
},
},
}
},
{
displayName: 'Options',
name: 'options',

View file

@ -39,17 +39,7 @@ export async function contentfulApiRequest(this: IExecuteFunctions | IExecuteSin
try {
return await this.helpers.request!(options);
} catch (error) {
let errorMessage = error;
// if (error.response && error.response.body && error.response.body.details) {
// const details = error.response.body.details;
// errorMessage = details.errors.map((e: IDataObject) => e.details).join('|');
// } else if (error.response && error.response.body && error.response.body.message) {
// errorMessage = error.response.body.message;
// }
throw new Error(`Contentful error response [${error.statusCode}]: ${errorMessage}`);
throw new Error(`Contentful error response [${error.statusCode}]: ${error.error.message}`);
}
}