mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 21:07:28 -08:00
fix(Discord Node): Fix wrong error message being displayed (#5547)
This commit is contained in:
parent
0fbb3f0f02
commit
e251439333
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue