@honeybadger-io/js 3.2.2 → 3.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -488,7 +488,7 @@ function formatCGIData(vars, prefix) {
488
488
  var notifier = {
489
489
  name: 'honeybadger-js',
490
490
  url: 'https://github.com/honeybadger-io/honeybadger-js',
491
- version: '3.2.2'
491
+ version: '3.2.6'
492
492
  };
493
493
  // Split at commas
494
494
  var TAG_SEPARATOR = /,/;
@@ -564,10 +564,6 @@ var Client = /** @class */ (function () {
564
564
  Client.prototype.notify = function (notice, name, extra) {
565
565
  if (name === void 0) { name = undefined; }
566
566
  if (extra === void 0) { extra = undefined; }
567
- if (!this.config.apiKey) {
568
- this.logger.warn('Unable to send error report: no API key has been configured');
569
- return false;
570
- }
571
567
  if (this.config.disabled) {
572
568
  this.logger.warn('Deprecation warning: instead of `disabled: true`, use `reportData: false` to explicitly disable Honeybadger reporting. (Dropping notice: honeybadger.js is disabled)');
573
569
  return false;
@@ -576,6 +572,10 @@ var Client = /** @class */ (function () {
576
572
  this.logger.debug('Dropping notice: honeybadger.js is in development mode');
577
573
  return false;
578
574
  }
575
+ if (!this.config.apiKey) {
576
+ this.logger.warn('Unable to send error report: no API key has been configured');
577
+ return false;
578
+ }
579
579
  notice = makeNotice(notice);
580
580
  if (name && !(typeof name === 'object')) {
581
581
  var n = String(name);
@@ -689,7 +689,8 @@ var Client = /** @class */ (function () {
689
689
  revision: notice.revision,
690
690
  hostname: this.config.hostname,
691
691
  time: new Date().toUTCString()
692
- }
692
+ },
693
+ details: notice.details || {}
693
694
  };
694
695
  };
695
696
  /** @internal */
@@ -834,26 +835,23 @@ function lambdaHandler(handler) {
834
835
  var dom = domain__default['default'].create();
835
836
  // eslint-disable-next-line @typescript-eslint/no-this-alias
836
837
  var hb = this;
837
- dom.on('error', function (err) {
838
- hb.notify(err, {
838
+ var hbHandler = function (err) {
839
+ var willNotify = hb.notify(err, {
839
840
  afterNotify: function () {
840
841
  hb.clear();
841
842
  callback(err);
842
843
  }
843
844
  });
844
- });
845
+ if (!willNotify) {
846
+ callback(err);
847
+ }
848
+ };
849
+ dom.on('error', hbHandler);
845
850
  dom.run(function () {
846
851
  process.nextTick(function () {
847
852
  Promise.resolve(handler.apply(this, args))
848
853
  .then(function () { hb.clear(); })
849
- .catch(function (err) {
850
- hb.notify(err, {
851
- afterNotify: function () {
852
- hb.clear();
853
- callback(err);
854
- }
855
- });
856
- });
854
+ .catch(hbHandler);
857
855
  });
858
856
  });
859
857
  }.bind(this);
@@ -64,6 +64,7 @@ export interface Notice {
64
64
  environment?: string | undefined;
65
65
  revision?: string | undefined;
66
66
  tags: string | string[];
67
+ details: Record<string, Record<string, unknown>>;
67
68
  __breadcrumbs: BreadcrumbRecord[];
68
69
  afterNotify?: AfterNotifyHandler;
69
70
  }
package/honeybadger.d.ts CHANGED
@@ -3,5 +3,6 @@
3
3
  import Server from './dist/server/types/server'
4
4
  import Browser from './dist/browser/types/browser'
5
5
 
6
- declare const Honeybadger: typeof Server & typeof Browser
7
- export = Honeybadger
6
+ type Honeybadger = typeof Server & typeof Browser;
7
+ declare const Honeybadger: Honeybadger;
8
+ export = Honeybadger;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@honeybadger-io/js",
3
- "version": "3.2.2",
3
+ "version": "3.2.6",
4
4
  "license": "MIT",
5
5
  "homepage": "https://github.com/honeybadger-io/honeybadger-js",
6
6
  "author": {
@@ -45,29 +45,29 @@
45
45
  "stacktrace-parser": "^0.1.10"
46
46
  },
47
47
  "devDependencies": {
48
- "@rollup/plugin-node-resolve": "^13.0.2",
48
+ "@rollup/plugin-node-resolve": "^13.0.4",
49
49
  "@rollup/plugin-replace": "^3.0.0",
50
- "@rollup/plugin-typescript": "^8.2.3",
51
- "@types/jest": "^26.0.24",
52
- "@typescript-eslint/eslint-plugin": "^4.28.3",
53
- "@typescript-eslint/parser": "^4.28.3",
54
- "axios": ">=0.21.1",
55
- "concurrently": "^6.2.0",
56
- "eslint": "^7.31.0",
57
- "eslint-plugin-import": "^2.23.4",
58
- "eslint-plugin-jest": "^24.3.6",
50
+ "@rollup/plugin-typescript": "^8.2.5",
51
+ "@types/jest": "^27.0.2",
52
+ "@typescript-eslint/eslint-plugin": "^5.0.0",
53
+ "@typescript-eslint/parser": "^5.0.0",
54
+ "axios": ">=0.21.4",
55
+ "concurrently": "^6.2.1",
56
+ "eslint": "^8.0.0",
57
+ "eslint-plugin-import": "^2.24.1",
58
+ "eslint-plugin-jest": "^25.0.1",
59
59
  "eslint-plugin-promise": "^5.1.0",
60
60
  "express": "^4.17.1",
61
61
  "jest": "^27.0.6",
62
- "nock": "^13.1.1",
63
- "rollup": "^2.53.2",
62
+ "nock": "^13.1.2",
63
+ "rollup": "^2.56.2",
64
64
  "rollup-plugin-uglify": "^6.0.2",
65
- "shipjs": "0.23.3",
66
- "sinon": "^11.1.1",
67
- "supertest": "^6.1.3",
68
- "ts-jest": "^27.0.3",
65
+ "shipjs": "0.24.0",
66
+ "sinon": "^11.1.2",
67
+ "supertest": "^6.1.6",
68
+ "ts-jest": "^27.0.5",
69
69
  "tsd": "^0.17.0",
70
- "tslib": "^2.3.0",
70
+ "tslib": "^2.3.1",
71
71
  "typescript": "^4.3.5"
72
72
  },
73
73
  "readmeFilename": "README.md",
package/CHANGELOG.md DELETED
@@ -1,69 +0,0 @@
1
- # Changelog
2
- All notable changes to this project will be documented in this file.
3
-
4
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
-
7
- ## [Unreleased][latest]
8
-
9
- ## [3.2.2] - 2021-07-19
10
- ### Fixed
11
- - TypeScript: Add missing methods typedefs (#611)
12
- - Internal: Fixed TypeScript types, added null checks, automated type declaration files
13
-
14
- ## [3.2.1] - 2021-05-17
15
- ### Fixed
16
- - TypeScript: Use express types for middleware (#564)
17
-
18
- ## [3.2.0] - 2021-03-30
19
- ### Fixed
20
- - Update Node API endpoint to enable source map processing for server-side errors.
21
-
22
- ### Added
23
- - Add tagging to errors with 3 possible API's
24
- ```bash
25
- Honeybadger.configure({tags: string | string[] | undefined})
26
- Honeybadger.setContext({tags: string | string[] | undefined})
27
- Honeybadger.notify('error', {tags: string | string[] | undefined})
28
- ```
29
-
30
- ## [3.1.0] - 2021-03-04
31
- ### Fixed
32
- - Add default reason for unhandled promises (previously reason was "undefined") (#546)
33
-
34
- ### Added
35
- - Add `Honeybadger.clear()` method to clear context and breadcrumbs
36
- - Deprecate `Honeybadger.resetContext()`
37
-
38
- ## [3.0.4] - 2021-03-01
39
- ### Fixed
40
- - Add server middleware signatures to type declarations (#540, @getabetterpic)
41
-
42
- ## [3.0.3] - 2021-02-02
43
- ### Fixed
44
- - types: Make sure every breadcrumb prop is optional (#527, @paambaati)
45
-
46
- ## [3.0.2] - 2021-01-28
47
- ### Fixed
48
- - utf8 encode JSON payload in Node
49
-
50
- ## [3.0.1] - 2021-01-20
51
- ### Fixed
52
- - Adjust backtrace display and logging in Node
53
- - Fix a bug in Node lambdaHandler
54
-
55
- ## [3.0.0] - 2021-01-19
56
- ### Added
57
- - [@honeybadger-io/js](https://www.npmjs.com/package/@honeybadger-io/js) is
58
- a new universal/isomorphic JavaScript package combining the deprecated
59
- [honeybadger-js for browsers](https://www.npmjs.com/package/honeybadger-js)
60
- and the [honeybadger for Node.js](https://www.npmjs.com/package/honeybadger)
61
- NPM packages.
62
-
63
- Moving forward, development for both platforms will happen here. The new API
64
- is mostly the same as the old packages, with a few breaking config changes.
65
- Users who are upgrading from either the *honeybadger-js* or *honeybadger* NPM
66
- packages should read [the upgrading
67
- guide](https://docs.honeybadger.io/lib/javascript/support/upgrading-to-v3.html),
68
- and all users should refer to the [new
69
- documentation](https://docs.honeybadger.io/lib/javascript/index.html).