@jsenv/plugin-supervisor 1.4.6 → 1.4.7

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.
@@ -530,7 +530,7 @@ window.__supervisor__ = (() => {
530
530
  }
531
531
  // isError can be false when reason is an ErrorEvent for instance
532
532
  exception.isError = reason instanceof Error;
533
- exception.name = reason.name || "Error";
533
+ exception.name = reason.constructor ? reason.constructor.name : reason.name || "Error";
534
534
  exception.message = reason.message || message || "";
535
535
  let stackFrames;
536
536
  if (exception.isError && Error.captureStackTrace &&
@@ -599,7 +599,7 @@ window.__supervisor__ = (() => {
599
599
  }
600
600
  exception.stackTrace = stackTrace;
601
601
  let stack = "";
602
- const name = reason.name || "Error";
602
+ const name = reason.constructor ? reason.constructor.name : reason.name || "Error";
603
603
  const message = reason.message || "";
604
604
  stack += "".concat(name, ": ").concat(message);
605
605
  if (stackTrace) {
@@ -777,7 +777,8 @@ window.__supervisor__ = (() => {
777
777
  const getErrorStackTrace = error => {
778
778
  let stack = error.stack;
779
779
  if (!stack) return "";
780
- const messageInStack = "".concat(error.name, ": ").concat(error.message);
780
+ const name = error.constructor ? error.constructor.name : error.name;
781
+ const messageInStack = "".concat(name, ": ").concat(error.message);
781
782
  if (stack.startsWith(messageInStack)) {
782
783
  stack = stack.slice(messageInStack.length);
783
784
  }
@@ -931,7 +932,7 @@ window.__supervisor__ = (() => {
931
932
  });
932
933
  if (cause) {
933
934
  const causeText = stringifyStack({
934
- name: cause.name,
935
+ name: cause.constructor ? cause.constructor.name : cause.name,
935
936
  message: cause.reason ? generateClickableText(cause.reason) : cause.stack ? generateClickableText(cause.stack) : ""
936
937
  });
937
938
  if (causeText) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/plugin-supervisor",
3
- "version": "1.4.6",
3
+ "version": "1.4.7",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -485,7 +485,9 @@ window.__supervisor__ = (() => {
485
485
  }
486
486
  // isError can be false when reason is an ErrorEvent for instance
487
487
  exception.isError = reason instanceof Error;
488
- exception.name = reason.name || "Error";
488
+ exception.name = reason.constructor
489
+ ? reason.constructor.name
490
+ : reason.name || "Error";
489
491
  exception.message = reason.message || message || "";
490
492
 
491
493
  let stackFrames;
@@ -557,7 +559,9 @@ window.__supervisor__ = (() => {
557
559
  exception.stackTrace = stackTrace;
558
560
 
559
561
  let stack = "";
560
- const name = reason.name || "Error";
562
+ const name = reason.constructor
563
+ ? reason.constructor.name
564
+ : reason.name || "Error";
561
565
  const message = reason.message || "";
562
566
  stack += `${name}: ${message}`;
563
567
  if (stackTrace) {
@@ -745,7 +749,8 @@ window.__supervisor__ = (() => {
745
749
  const getErrorStackTrace = (error) => {
746
750
  let stack = error.stack;
747
751
  if (!stack) return "";
748
- const messageInStack = `${error.name}: ${error.message}`;
752
+ const name = error.constructor ? error.constructor.name : error.name;
753
+ const messageInStack = `${name}: ${error.message}`;
749
754
  if (stack.startsWith(messageInStack)) {
750
755
  stack = stack.slice(messageInStack.length);
751
756
  }
@@ -923,7 +928,7 @@ window.__supervisor__ = (() => {
923
928
  });
924
929
  if (cause) {
925
930
  const causeText = stringifyStack({
926
- name: cause.name,
931
+ name: cause.constructor ? cause.constructor.name : cause.name,
927
932
  message: cause.reason
928
933
  ? generateClickableText(cause.reason)
929
934
  : cause.stack