mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
⚡ Add description to NodeOperationError (#2148)
This commit is contained in:
@@ -202,11 +202,15 @@ abstract class NodeError extends Error {
|
|||||||
* Class for instantiating an operational error, e.g. an invalid credentials error.
|
* Class for instantiating an operational error, e.g. an invalid credentials error.
|
||||||
*/
|
*/
|
||||||
export class NodeOperationError extends NodeError {
|
export class NodeOperationError extends NodeError {
|
||||||
constructor(node: INode, error: Error | string) {
|
constructor(node: INode, error: Error | string, options?: { description: string }) {
|
||||||
if (typeof error === 'string') {
|
if (typeof error === 'string') {
|
||||||
error = new Error(error);
|
error = new Error(error);
|
||||||
}
|
}
|
||||||
super(node, error);
|
super(node, error);
|
||||||
|
|
||||||
|
if (options?.description) {
|
||||||
|
this.description = options.description;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user