mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 04:04:06 -08:00
⚡ Add description to NodeOperationError (#2148)
This commit is contained in:
parent
1dfebf0363
commit
57025a7b79
|
@ -202,11 +202,15 @@ abstract class NodeError extends Error {
|
|||
* Class for instantiating an operational error, e.g. an invalid credentials error.
|
||||
*/
|
||||
export class NodeOperationError extends NodeError {
|
||||
constructor(node: INode, error: Error | string) {
|
||||
constructor(node: INode, error: Error | string, options?: { description: string }) {
|
||||
if (typeof error === 'string') {
|
||||
error = new Error(error);
|
||||
}
|
||||
super(node, error);
|
||||
|
||||
if (options?.description) {
|
||||
this.description = options.description;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue