Skip to content

Commit

Permalink
fix: add error stack
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode committed Sep 13, 2024
1 parent 48a6dc0 commit 8ed459e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions libs/ng-morph/src/utils/get-declaration-getter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ export function getDeclarationGetter<
try {
return matchQuery(declaration.getStructure(), query);
} catch (error: unknown) {
const filePath = declaration.getSourceFile().getFilePath();
const path = declaration.getSourceFile().getFilePath();
const err = error as Error;

throw new Error(`Error in ${filePath}\n${(error as Error).message}`);
throw new Error(
`ATTENTION: An error occurred during migration in ${path}\n${err.message}\n${err.stack}`,
);
}
});
};
Expand Down

0 comments on commit 8ed459e

Please sign in to comment.