parent
508d92f759
commit
ca348b2ff6
@ -0,0 +1,15 @@
|
|||||||
|
/**
|
||||||
|
* Error class used to generate debug stack traces, not thrown.
|
||||||
|
*/
|
||||||
|
export class DebuggingTraceIsNotAnError extends Error {
|
||||||
|
static getTrace(): string {
|
||||||
|
const oldLimit = Error.stackTraceLimit
|
||||||
|
if ( oldLimit < 50 ) {
|
||||||
|
Error.stackTraceLimit = 50
|
||||||
|
}
|
||||||
|
|
||||||
|
const trace = (new this()).stack || String(new this())
|
||||||
|
Error.stackTraceLimit = oldLimit
|
||||||
|
return trace
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue