Skip to content

Commit

Permalink
Fix panic origin name
Browse files Browse the repository at this point in the history
  • Loading branch information
bkiac committed Nov 3, 2023
1 parent 65b38aa commit 6016137
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/error/panic.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {inspectSymbol} from "../util"
import {getName, replaceStack} from "./util"
import {getName, getOriginName, replaceStack} from "./util"

export class Panic extends Error {
readonly origin?: Error
Expand All @@ -13,7 +13,7 @@ export class Panic extends Error {
} else {
super(messageOrError)
}
this.originName = this.origin?.name ?? "Error"
this.originName = getOriginName(this.origin)
this.name = getName("Panic", this.originName)
this._stack = this.stack // Save a copy of the stack trace before it gets overridden.
}
Expand Down

0 comments on commit 6016137

Please sign in to comment.