Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

backtrace-node

Package Overview
Dependencies
Maintainers
4
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

backtrace-node - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

10

CHANGELOG.md
# Backtrace Node Release Notes
## Version 1.0.3 06.06.2019
* Added new events to event emitter: `new-report`, `unhandledRejection`, `uncaughtException`. `uncaughtException` and `unhandledRejection` events will be emited by library when library catch unhandled exception or unhandler promise rejection. `new-report` event will be emited when library create new `backtraceReport` object.
## Version 1.0.2 05.06.2019
* Fixed arguments in callback function in report `send` method.
## Version 1.0.1 05.06.2019
* Added type definition for report `send` method
## Version 1.0.0 04.06.2019

@@ -4,0 +14,0 @@

12

lib/backtraceClient.js

@@ -110,2 +110,3 @@ "use strict";

if (fileAttachments === void 0) { fileAttachments = []; }
this.emit('new-report', payload, reportAttributes);
var attributes = this.combineClientAttributes(reportAttributes);

@@ -164,8 +165,11 @@ var report = new backtraceReport_1.BacktraceReport(payload, attributes, fileAttachments);

}
this._backtraceApi.send(report).then(function (result) {
this._backtraceApi
.send(report)
.then(function (result) {
if (callback) {
callback(undefined);
callback(result.Error);
}
_this.emit('after-send', report, result);
}).catch(function (err) {
})
.catch(function (err) {
if (callback) {

@@ -248,2 +252,3 @@ callback(err);

process.on('unhandledRejection', function (err) {
_this.emit('unhandledRejection', err);
_this.reportAsync(err, undefined);

@@ -260,2 +265,3 @@ });

process.on('uncaughtException', function (e) {
_this.emit('uncaughtException', e);
_this.reportSync(e);

@@ -262,0 +268,0 @@ throw e;

{
"name": "backtrace-node",
"version": "1.0.2",
"version": "1.0.3",
"description": "Backtrace error reporting tool",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

@@ -62,2 +62,3 @@ import { ClientRateLimit } from './clientRateLimit';

): BacktraceReport {
this.emit('new-report', payload, reportAttributes);
const attributes = this.combineClientAttributes(reportAttributes);

@@ -111,12 +112,15 @@ const report = new BacktraceReport(payload, attributes, fileAttachments);

}
this._backtraceApi.send(report).then((result) => {
if (callback) {
callback(undefined);
}
this.emit('after-send', report, result);
}).catch(err => {
if (callback) {
callback(err);
}
});
this._backtraceApi
.send(report)
.then((result) => {
if (callback) {
callback(result.Error);
}
this.emit('after-send', report, result);
})
.catch((err) => {
if (callback) {
callback(err);
}
});

@@ -132,3 +136,3 @@ return BacktraceResult.Processing(report);

}
return await this._backtraceApi.send(report)
return await this._backtraceApi.send(report);
}

@@ -199,2 +203,3 @@

(process as NodeJS.EventEmitter).on('unhandledRejection', (err: Error) => {
this.emit('unhandledRejection', err);
this.reportAsync(err, undefined);

@@ -212,2 +217,3 @@ });

process.on('uncaughtException', (e: Error) => {
this.emit('uncaughtException', e);
this.reportSync(e);

@@ -214,0 +220,0 @@ throw e;

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