@watchforge/browser 0.1.15 → 0.1.16
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.
- package/package.json +1 -1
- package/src/client.js +16 -1
- package/src/index.d.ts +1 -0
package/package.json
CHANGED
package/src/client.js
CHANGED
|
@@ -25,6 +25,7 @@ let CAPTURE_CONSOLE_ERRORS = true;
|
|
|
25
25
|
let CAPTURE_RESOURCE_ERRORS = true;
|
|
26
26
|
let CAPTURE_FAILED_REQUESTS = true;
|
|
27
27
|
let CAPTURE_NODE_WARNINGS = false;
|
|
28
|
+
let CAPTURE_NODE_MULTIPLE_RESOLVES = false;
|
|
28
29
|
|
|
29
30
|
// Detect environment
|
|
30
31
|
const isBrowser = typeof window !== "undefined";
|
|
@@ -594,6 +595,7 @@ export function register({
|
|
|
594
595
|
captureResourceErrors = true,
|
|
595
596
|
captureFailedRequests = true,
|
|
596
597
|
captureNodeWarnings = false,
|
|
598
|
+
captureNodeMultipleResolves = false,
|
|
597
599
|
projectRoot = null,
|
|
598
600
|
}) {
|
|
599
601
|
const nextBrowserRegisterKey = isBrowser
|
|
@@ -626,6 +628,7 @@ export function register({
|
|
|
626
628
|
CAPTURE_RESOURCE_ERRORS = Boolean(captureResourceErrors);
|
|
627
629
|
CAPTURE_FAILED_REQUESTS = Boolean(captureFailedRequests);
|
|
628
630
|
CAPTURE_NODE_WARNINGS = Boolean(captureNodeWarnings);
|
|
631
|
+
CAPTURE_NODE_MULTIPLE_RESOLVES = Boolean(captureNodeMultipleResolves);
|
|
629
632
|
setProjectRoot(
|
|
630
633
|
projectRoot ||
|
|
631
634
|
(isNode ? process.env.WATCHFORGE_PROJECT_ROOT || process.env.INIT_CWD : null)
|
|
@@ -682,11 +685,23 @@ export function register({
|
|
|
682
685
|
});
|
|
683
686
|
|
|
684
687
|
process.on("multipleResolves", (type, promise, reason) => {
|
|
688
|
+
addBreadcrumb({
|
|
689
|
+
type: "error",
|
|
690
|
+
level: "warning",
|
|
691
|
+
category: "process.multipleResolves",
|
|
692
|
+
message: `Node.js promise multipleResolves: ${type}`,
|
|
693
|
+
data: {
|
|
694
|
+
type,
|
|
695
|
+
reason: reason?.message || String(reason || ""),
|
|
696
|
+
},
|
|
697
|
+
});
|
|
698
|
+
|
|
699
|
+
if (!CAPTURE_NODE_MULTIPLE_RESOLVES) return;
|
|
685
700
|
void captureException(
|
|
686
701
|
normalizeException(reason, `Node.js promise multipleResolves: ${type}`),
|
|
687
702
|
{
|
|
688
703
|
tags: {
|
|
689
|
-
handled:
|
|
704
|
+
handled: true,
|
|
690
705
|
mechanism: "process.multipleResolves",
|
|
691
706
|
type,
|
|
692
707
|
},
|
package/src/index.d.ts
CHANGED