mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -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 {
|
try {
|
||||||
//@ts-expect-error
|
//@ts-expect-error
|
||||||
body.embeds = JSON.parse(options.embeds);
|
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) {
|
} catch (e) {
|
||||||
throw new NodeOperationError(this.getNode(), 'Embeds must be valid JSON.', {
|
throw new NodeOperationError(this.getNode(), 'Embeds must be valid JSON.', {
|
||||||
itemIndex: i,
|
itemIndex: i,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (!Array.isArray(body.embeds)) {
|
||||||
|
throw new NodeOperationError(this.getNode(), 'Embeds must be an array of embeds.', {
|
||||||
|
itemIndex: i,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (options.username) {
|
if (options.username) {
|
||||||
body.username = options.username as string;
|
body.username = options.username as string;
|
||||||
|
|
Loading…
Reference in a new issue