Skip to content

Commit

Permalink
Log stack trace if error.stack is defined (#5035)
Browse files Browse the repository at this point in the history
- Fixes #5034
  • Loading branch information
mikeharder authored Oct 31, 2024
1 parent 18590bc commit 7b45448
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions common/changes/@autorest/core/error-stack_2024-10-30-23-17.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@autorest/core",
"comment": "Include stack trace when logging errors",
"type": "patch"
}
],
"packageName": "@autorest/core"
}
3 changes: 3 additions & 0 deletions packages/extensions/core/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,9 @@ async function main() {
if (e !== false) {
logger.log({ level: "error", message: `!${e}` });
}
if ((e as any).stack) {
logger.log({ level: "error", message: `stack: ${(e as any).stack}` });
}
logger.log({
level: "error",
message:
Expand Down

0 comments on commit 7b45448

Please sign in to comment.