fix(Discord Node): Fix wrong error message being displayed (#5547)
This commit is contained in:
@@ -133,16 +133,16 @@ export class Discord implements INodeType {
|
||||
try {
|
||||
//@ts-expect-error
|
||||
body.embeds = JSON.parse(options.embeds);
|
||||
if (!Array.isArray(body.embeds)) {
|
||||
throw new NodeOperationError(this.getNode(), 'Embeds must be an array of embeds.', {
|
||||
itemIndex: i,
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
throw new NodeOperationError(this.getNode(), 'Embeds must be valid JSON.', {
|
||||
itemIndex: i,
|
||||
});
|
||||
}
|
||||
if (!Array.isArray(body.embeds)) {
|
||||
throw new NodeOperationError(this.getNode(), 'Embeds must be an array of embeds.', {
|
||||
itemIndex: i,
|
||||
});
|
||||
}
|
||||
}
|
||||
if (options.username) {
|
||||
body.username = options.username as string;
|
||||
|
||||
Reference in New Issue
Block a user