Skip to content

Commit

Permalink
Printed error
Browse files Browse the repository at this point in the history
  • Loading branch information
ackava committed Dec 14, 2024
1 parent 0c14c8b commit e778cd5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/core/ProcessFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ export default async function ProcessFiles({
}
if (element?.[isXNode]) {
element.log = log;
await element.execute();
try {
await element.execute();
} catch (error) {
console.error(error.stack ?? error);
}
continue;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/XNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default class XNode {
failed?.(error);
if (throwOnFail) {
console.log(`failed ${this.name.name} at ${this.attributes?.location}`);
throw new (Error as any)(`Failed ${this.name.name} on ${this.attributes?.location}`, { cause: error });
throw new (Error as any)(`Failed ${this.name.name} on ${this.attributes?.location}`, { cause: error.cause ?? error });
}
}
return result;
Expand Down

0 comments on commit e778cd5

Please sign in to comment.