posthog-js-lite 3.4.0 → 3.4.1
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/CHANGELOG.md +6 -0
- package/lib/index.cjs.js +6 -3
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.esm.js +6 -3
- package/lib/index.esm.js.map +1 -1
- package/lib/posthog-core/src/index.d.ts +1 -1
- package/lib/posthog-core/src/utils.d.ts +1 -0
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -320,7 +320,7 @@ declare abstract class PostHogCore extends PostHogCoreStateless {
|
|
|
320
320
|
/***
|
|
321
321
|
*** ERROR TRACKING
|
|
322
322
|
***/
|
|
323
|
-
captureException(error:
|
|
323
|
+
captureException(error: unknown, additionalProperties?: {
|
|
324
324
|
[key: string]: any;
|
|
325
325
|
}): void;
|
|
326
326
|
/**
|
package/lib/index.esm.js
CHANGED
|
@@ -62,6 +62,9 @@ function safeSetTimeout(fn, timeout) {
|
|
|
62
62
|
t?.unref && t?.unref();
|
|
63
63
|
return t;
|
|
64
64
|
}
|
|
65
|
+
const isError = (x) => {
|
|
66
|
+
return x instanceof Error;
|
|
67
|
+
};
|
|
65
68
|
function getFetch() {
|
|
66
69
|
return typeof fetch !== 'undefined' ? fetch : typeof global.fetch !== 'undefined' ? global.fetch : undefined;
|
|
67
70
|
}
|
|
@@ -1924,8 +1927,8 @@ class PostHogCore extends PostHogCoreStateless {
|
|
|
1924
1927
|
$exception_level: 'error',
|
|
1925
1928
|
$exception_list: [
|
|
1926
1929
|
{
|
|
1927
|
-
type: error.name,
|
|
1928
|
-
value: error.message,
|
|
1930
|
+
type: isError(error) ? error.name : 'Error',
|
|
1931
|
+
value: isError(error) ? error.message : error,
|
|
1929
1932
|
mechanism: {
|
|
1930
1933
|
handled: true,
|
|
1931
1934
|
synthetic: false,
|
|
@@ -1963,7 +1966,7 @@ class PostHogCore extends PostHogCoreStateless {
|
|
|
1963
1966
|
}
|
|
1964
1967
|
}
|
|
1965
1968
|
|
|
1966
|
-
var version = "3.4.
|
|
1969
|
+
var version = "3.4.1";
|
|
1967
1970
|
|
|
1968
1971
|
function getContext(window) {
|
|
1969
1972
|
let context = {};
|