Improve error message

This commit is contained in:
ricardo 2020-06-08 16:13:17 -04:00
parent 8ee60e471b
commit 918fba81cc

View file

@ -133,7 +133,15 @@ export class Twitter implements INodeType {
let attachmentBody = {};
let response: IDataObject = {};
if (binaryData[binaryPropertyName].mimeType.includes('image')) {
const isAnimatedWebp = (Buffer.from(binaryData[binaryPropertyName].data, 'base64').toString().indexOf('ANMF') !== -1);
const isImage = binaryData[binaryPropertyName].mimeType.includes('image');
if (isImage && isAnimatedWebp) {
throw new Error('Animated .webp images are not supported use .git instead');
}
if (isImage) {
const attachmentBody = {
media_data: binaryData[binaryPropertyName].data,