@dxos/debug
Advanced tools
Comparing version 2.10.10 to 2.10.11
@@ -6,6 +6,4 @@ export declare type ErrorHandlerCallback = (error: Error) => void; | ||
export declare class ErrorStream { | ||
private readonly _creationStack; | ||
private _handler; | ||
private _unhandledErrors; | ||
constructor(); | ||
assertNoUnhandledErrors(): void; | ||
@@ -12,0 +10,0 @@ raise(error: Error): void; |
@@ -7,3 +7,2 @@ "use strict"; | ||
exports.ErrorStream = void 0; | ||
const stack_trace_1 = require("./stack-trace"); | ||
/** | ||
@@ -15,7 +14,6 @@ * Represents a stream of errors that entities can expose. | ||
this._unhandledErrors = 0; | ||
this._creationStack = stack_trace_1.getStackTrace(); | ||
} | ||
assertNoUnhandledErrors() { | ||
if (this._unhandledErrors > 0) { | ||
throw new Error(`Assertion failed: expected no unhandled errors to be thrown, but ${this._unhandledErrors} were thrown.\nThey originated from:\n${this._creationStack}`); | ||
throw new Error(`Assertion failed: expected no unhandled errors to be thrown, but ${this._unhandledErrors} were thrown.`); | ||
} | ||
@@ -39,4 +37,5 @@ } | ||
this._unhandledErrors++; | ||
console.error(error); | ||
console.error(`The above unhandled error originated from:\n${this._creationStack}`); | ||
setTimeout(() => { | ||
throw error; | ||
}); | ||
} | ||
@@ -43,0 +42,0 @@ } |
{ | ||
"name": "@dxos/debug", | ||
"version": "2.10.10", | ||
"version": "2.10.11", | ||
"description": "Debug utilities", | ||
@@ -5,0 +5,0 @@ "bugs": { |
@@ -5,4 +5,2 @@ // | ||
import { getStackTrace } from './stack-trace'; | ||
export type ErrorHandlerCallback = (error: Error) => void; | ||
@@ -14,4 +12,2 @@ | ||
export class ErrorStream { | ||
private readonly _creationStack: string; | ||
private _handler: ErrorHandlerCallback | undefined; | ||
@@ -21,9 +17,5 @@ | ||
constructor () { | ||
this._creationStack = getStackTrace(); | ||
} | ||
assertNoUnhandledErrors () { | ||
if (this._unhandledErrors > 0) { | ||
throw new Error(`Assertion failed: expected no unhandled errors to be thrown, but ${this._unhandledErrors} were thrown.\nThey originated from:\n${this._creationStack}`); | ||
throw new Error(`Assertion failed: expected no unhandled errors to be thrown, but ${this._unhandledErrors} were thrown.`); | ||
} | ||
@@ -51,5 +43,6 @@ } | ||
console.error(error); | ||
console.error(`The above unhandled error originated from:\n${this._creationStack}`); | ||
setTimeout(() => { | ||
throw error; | ||
}); | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
70
834
113415