@thi.ng/rstream 9.5.1 → 9.5.2

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/subscription.js +3 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/rstream",
3
- "version": "9.5.1",
3
+ "version": "9.5.2",
4
4
  "description": "Reactive streams & subscription primitives for constructing dataflow graphs / pipelines",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -223,5 +223,5 @@
223
223
  ],
224
224
  "year": 2017
225
225
  },
226
- "gitHead": "27c7195e4ebd818402f3bf5ae0d1d21d7c108e99"
226
+ "gitHead": "2085e9600e121134429c85f6d0ead46e3ce920ca"
227
227
  }
package/subscription.js CHANGED
@@ -4,6 +4,7 @@ import { isPlainObject } from "@thi.ng/checks/is-plain-object";
4
4
  import { assert } from "@thi.ng/errors/assert";
5
5
  import { illegalState } from "@thi.ng/errors/illegal-state";
6
6
  import { NULL_LOGGER } from "@thi.ng/logger/null";
7
+ import { ROOT } from "@thi.ng/logger/root";
7
8
  import { comp } from "@thi.ng/transducers/comp";
8
9
  import { map } from "@thi.ng/transducers/map";
9
10
  import { push } from "@thi.ng/transducers/push";
@@ -143,11 +144,8 @@ class Subscription {
143
144
  return errorHandler?.(e) || this.unhandledError(e);
144
145
  }
145
146
  unhandledError(e) {
146
- (LOGGER.parent !== NULL_LOGGER ? LOGGER : console).warn(
147
- this.id,
148
- "unhandled error:",
149
- e
150
- );
147
+ const isNullLogger = LOGGER.parent === NULL_LOGGER || LOGGER.parent === ROOT && ROOT.parent === NULL_LOGGER;
148
+ (isNullLogger ? console : LOGGER).warn(this.id, "unhandled error:", e);
151
149
  this.unsubscribe();
152
150
  this.state = State.ERROR;
153
151
  return false;