Socket
Socket
Sign inDemoInstall

@dxos/debug

Package Overview
Dependencies
Maintainers
18
Versions
3056
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dxos/debug - npm Package Compare versions

Comparing version 2.10.10 to 2.10.11

CHANGELOG.json

2

dist/src/error-stream.d.ts

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc