sentry-uniapp 1.0.12 → 2.8.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/README.md +11 -9
- package/dist/client.d.ts +42 -40
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +62 -41
- package/dist/client.js.map +1 -1
- package/dist/crossPlatform.d.ts +1 -1
- package/dist/crossPlatform.d.ts.map +1 -1
- package/dist/crossPlatform.js +26 -10
- package/dist/crossPlatform.js.map +1 -1
- package/dist/debug.d.ts +4 -0
- package/dist/debug.d.ts.map +1 -0
- package/dist/debug.js +23 -0
- package/dist/debug.js.map +1 -0
- package/dist/eventbuilder.d.ts +9 -10
- package/dist/eventbuilder.d.ts.map +1 -1
- package/dist/eventbuilder.js +131 -58
- package/dist/eventbuilder.js.map +1 -1
- package/dist/flags.js +1 -0
- package/dist/flags.js.map +1 -1
- package/dist/index.d.ts +10 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +84 -21
- package/dist/index.js.map +1 -1
- package/dist/integrations/globalhandlers.d.ts +10 -44
- package/dist/integrations/globalhandlers.d.ts.map +1 -1
- package/dist/integrations/globalhandlers.js +101 -134
- package/dist/integrations/globalhandlers.js.map +1 -1
- package/dist/integrations/ignoreMpcrawlerErrors.d.ts +3 -18
- package/dist/integrations/ignoreMpcrawlerErrors.d.ts.map +1 -1
- package/dist/integrations/ignoreMpcrawlerErrors.js +28 -28
- package/dist/integrations/ignoreMpcrawlerErrors.js.map +1 -1
- package/dist/integrations/index.d.ts +4 -6
- package/dist/integrations/index.d.ts.map +1 -1
- package/dist/integrations/index.js +12 -10
- package/dist/integrations/index.js.map +1 -1
- package/dist/integrations/router.d.ts +6 -24
- package/dist/integrations/router.d.ts.map +1 -1
- package/dist/integrations/router.js +39 -42
- package/dist/integrations/router.js.map +1 -1
- package/dist/integrations/system.d.ts +5 -16
- package/dist/integrations/system.d.ts.map +1 -1
- package/dist/integrations/system.js +62 -60
- package/dist/integrations/system.js.map +1 -1
- package/dist/parsers.d.ts +2 -2
- package/dist/parsers.d.ts.map +1 -1
- package/dist/parsers.js +27 -26
- package/dist/parsers.js.map +1 -1
- package/dist/polyfills.d.ts +5 -0
- package/dist/polyfills.d.ts.map +1 -0
- package/dist/polyfills.js +100 -0
- package/dist/polyfills.js.map +1 -0
- package/dist/sdk.d.ts +10 -85
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.js +69 -127
- package/dist/sdk.js.map +1 -1
- package/dist/tracekit.js +35 -33
- package/dist/tracekit.js.map +1 -1
- package/dist/transport.d.ts +7 -0
- package/dist/transport.d.ts.map +1 -0
- package/dist/transport.js +75 -0
- package/dist/transport.js.map +1 -0
- package/dist/transports/index.d.ts +1 -2
- package/dist/transports/index.d.ts.map +1 -1
- package/dist/transports/index.js +4 -4
- package/dist/transports/index.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +2 -2
- package/dist/version.js.map +1 -1
- package/esm/client.d.ts +42 -40
- package/esm/client.d.ts.map +1 -1
- package/esm/client.js +59 -40
- package/esm/client.js.map +1 -1
- package/esm/crossPlatform.d.ts +1 -1
- package/esm/crossPlatform.d.ts.map +1 -1
- package/esm/crossPlatform.js +25 -10
- package/esm/crossPlatform.js.map +1 -1
- package/esm/debug.d.ts +4 -0
- package/esm/debug.d.ts.map +1 -0
- package/esm/debug.js +18 -0
- package/esm/debug.js.map +1 -0
- package/esm/eventbuilder.d.ts +9 -10
- package/esm/eventbuilder.d.ts.map +1 -1
- package/esm/eventbuilder.js +125 -52
- package/esm/eventbuilder.js.map +1 -1
- package/esm/flags.js +1 -1
- package/esm/flags.js.map +1 -1
- package/esm/index.d.ts +10 -9
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +13 -8
- package/esm/index.js.map +1 -1
- package/esm/integrations/globalhandlers.d.ts +10 -44
- package/esm/integrations/globalhandlers.d.ts.map +1 -1
- package/esm/integrations/globalhandlers.js +99 -133
- package/esm/integrations/globalhandlers.js.map +1 -1
- package/esm/integrations/ignoreMpcrawlerErrors.d.ts +3 -18
- package/esm/integrations/ignoreMpcrawlerErrors.d.ts.map +1 -1
- package/esm/integrations/ignoreMpcrawlerErrors.js +25 -26
- package/esm/integrations/ignoreMpcrawlerErrors.js.map +1 -1
- package/esm/integrations/index.d.ts +4 -6
- package/esm/integrations/index.d.ts.map +1 -1
- package/esm/integrations/index.js +5 -6
- package/esm/integrations/index.js.map +1 -1
- package/esm/integrations/router.d.ts +6 -24
- package/esm/integrations/router.d.ts.map +1 -1
- package/esm/integrations/router.js +37 -41
- package/esm/integrations/router.js.map +1 -1
- package/esm/integrations/system.d.ts +5 -16
- package/esm/integrations/system.d.ts.map +1 -1
- package/esm/integrations/system.js +60 -59
- package/esm/integrations/system.js.map +1 -1
- package/esm/parsers.d.ts +2 -2
- package/esm/parsers.d.ts.map +1 -1
- package/esm/parsers.js +20 -19
- package/esm/parsers.js.map +1 -1
- package/esm/polyfills.d.ts +5 -0
- package/esm/polyfills.d.ts.map +1 -0
- package/esm/polyfills.js +100 -0
- package/esm/polyfills.js.map +1 -0
- package/esm/sdk.d.ts +10 -85
- package/esm/sdk.d.ts.map +1 -1
- package/esm/sdk.js +63 -120
- package/esm/sdk.js.map +1 -1
- package/esm/tracekit.js +33 -31
- package/esm/tracekit.js.map +1 -1
- package/esm/transport.d.ts +7 -0
- package/esm/transport.d.ts.map +1 -0
- package/esm/transport.js +71 -0
- package/esm/transport.js.map +1 -0
- package/esm/transports/index.d.ts +1 -2
- package/esm/transports/index.d.ts.map +1 -1
- package/esm/transports/index.js +1 -2
- package/esm/transports/index.js.map +1 -1
- package/esm/version.d.ts +1 -1
- package/esm/version.d.ts.map +1 -1
- package/esm/version.js +2 -3
- package/esm/version.js.map +1 -1
- package/package.json +23 -27
- package/dist/backend.d.ts +0 -41
- package/dist/backend.d.ts.map +0 -1
- package/dist/backend.js +0 -68
- package/dist/backend.js.map +0 -1
- package/dist/helpers.d.ts +0 -35
- package/dist/helpers.d.ts.map +0 -1
- package/dist/helpers.js +0 -236
- package/dist/helpers.js.map +0 -1
- package/dist/integrations/linkederrors.d.ts +0 -40
- package/dist/integrations/linkederrors.d.ts.map +0 -1
- package/dist/integrations/linkederrors.js +0 -65
- package/dist/integrations/linkederrors.js.map +0 -1
- package/dist/integrations/trycatch.d.ts +0 -26
- package/dist/integrations/trycatch.d.ts.map +0 -1
- package/dist/integrations/trycatch.js +0 -166
- package/dist/integrations/trycatch.js.map +0 -1
- package/dist/package.json +0 -52
- package/dist/sentry-uniapp.min.js +0 -3
- package/dist/sentry-uniapp.min.js.LICENSE.txt +0 -14
- package/dist/sentry-uniapp.min.js.map +0 -1
- package/dist/src/backend.d.ts +0 -41
- package/dist/src/backend.d.ts.map +0 -1
- package/dist/src/backend.js +0 -68
- package/dist/src/backend.js.map +0 -1
- package/dist/src/client.d.ts +0 -55
- package/dist/src/client.d.ts.map +0 -1
- package/dist/src/client.js +0 -51
- package/dist/src/client.js.map +0 -1
- package/dist/src/crossPlatform.d.ts +0 -18
- package/dist/src/crossPlatform.d.ts.map +0 -1
- package/dist/src/crossPlatform.js +0 -80
- package/dist/src/crossPlatform.js.map +0 -1
- package/dist/src/eventbuilder.d.ts +0 -11
- package/dist/src/eventbuilder.d.ts.map +0 -1
- package/dist/src/eventbuilder.js +0 -79
- package/dist/src/eventbuilder.js.map +0 -1
- package/dist/src/flags.d.ts +0 -3
- package/dist/src/flags.d.ts.map +0 -1
- package/dist/src/flags.js +0 -18
- package/dist/src/flags.js.map +0 -1
- package/dist/src/helpers.d.ts +0 -35
- package/dist/src/helpers.d.ts.map +0 -1
- package/dist/src/helpers.js +0 -236
- package/dist/src/helpers.js.map +0 -1
- package/dist/src/index.d.ts +0 -10
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -40
- package/dist/src/index.js.map +0 -1
- package/dist/src/integrations/globalhandlers.d.ts +0 -47
- package/dist/src/integrations/globalhandlers.d.ts.map +0 -1
- package/dist/src/integrations/globalhandlers.js +0 -153
- package/dist/src/integrations/globalhandlers.js.map +0 -1
- package/dist/src/integrations/ignoreMpcrawlerErrors.d.ts +0 -21
- package/dist/src/integrations/ignoreMpcrawlerErrors.d.ts.map +0 -1
- package/dist/src/integrations/ignoreMpcrawlerErrors.js +0 -40
- package/dist/src/integrations/ignoreMpcrawlerErrors.js.map +0 -1
- package/dist/src/integrations/index.d.ts +0 -7
- package/dist/src/integrations/index.d.ts.map +0 -1
- package/dist/src/integrations/index.js +0 -14
- package/dist/src/integrations/index.js.map +0 -1
- package/dist/src/integrations/linkederrors.d.ts +0 -40
- package/dist/src/integrations/linkederrors.d.ts.map +0 -1
- package/dist/src/integrations/linkederrors.js +0 -65
- package/dist/src/integrations/linkederrors.js.map +0 -1
- package/dist/src/integrations/router.d.ts +0 -28
- package/dist/src/integrations/router.d.ts.map +0 -1
- package/dist/src/integrations/router.js +0 -47
- package/dist/src/integrations/router.js.map +0 -1
- package/dist/src/integrations/system.d.ts +0 -17
- package/dist/src/integrations/system.d.ts.map +0 -1
- package/dist/src/integrations/system.js +0 -65
- package/dist/src/integrations/system.js.map +0 -1
- package/dist/src/integrations/trycatch.d.ts +0 -26
- package/dist/src/integrations/trycatch.d.ts.map +0 -1
- package/dist/src/integrations/trycatch.js +0 -166
- package/dist/src/integrations/trycatch.js.map +0 -1
- package/dist/src/parsers.d.ts +0 -21
- package/dist/src/parsers.d.ts.map +0 -1
- package/dist/src/parsers.js +0 -97
- package/dist/src/parsers.js.map +0 -1
- package/dist/src/sdk.d.ts +0 -99
- package/dist/src/sdk.d.ts.map +0 -1
- package/dist/src/sdk.js +0 -155
- package/dist/src/sdk.js.map +0 -1
- package/dist/src/tracekit.d.ts +0 -38
- package/dist/src/tracekit.d.ts.map +0 -1
- package/dist/src/tracekit.js +0 -222
- package/dist/src/tracekit.js.map +0 -1
- package/dist/src/transports/base.d.ts +0 -22
- package/dist/src/transports/base.d.ts.map +0 -1
- package/dist/src/transports/base.js +0 -28
- package/dist/src/transports/base.js.map +0 -1
- package/dist/src/transports/index.d.ts +0 -3
- package/dist/src/transports/index.d.ts.map +0 -1
- package/dist/src/transports/index.js +0 -6
- package/dist/src/transports/index.js.map +0 -1
- package/dist/src/transports/xhr.d.ts +0 -10
- package/dist/src/transports/xhr.d.ts.map +0 -1
- package/dist/src/transports/xhr.js +0 -42
- package/dist/src/transports/xhr.js.map +0 -1
- package/dist/src/version.d.ts +0 -3
- package/dist/src/version.d.ts.map +0 -1
- package/dist/src/version.js +0 -6
- package/dist/src/version.js.map +0 -1
- package/dist/transports/base.d.ts +0 -22
- package/dist/transports/base.d.ts.map +0 -1
- package/dist/transports/base.js +0 -28
- package/dist/transports/base.js.map +0 -1
- package/dist/transports/xhr.d.ts +0 -10
- package/dist/transports/xhr.d.ts.map +0 -1
- package/dist/transports/xhr.js +0 -42
- package/dist/transports/xhr.js.map +0 -1
- package/dist/utils/debug-build.d.ts +0 -7
- package/dist/utils/debug-build.d.ts.map +0 -1
- package/dist/utils/debug-build.js +0 -9
- package/dist/utils/debug-build.js.map +0 -1
- package/dist/utils/logger.d.ts +0 -16
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js +0 -50
- package/dist/utils/logger.js.map +0 -1
- package/esm/backend.d.ts +0 -41
- package/esm/backend.d.ts.map +0 -1
- package/esm/backend.js +0 -66
- package/esm/backend.js.map +0 -1
- package/esm/helpers.d.ts +0 -35
- package/esm/helpers.d.ts.map +0 -1
- package/esm/helpers.js +0 -229
- package/esm/helpers.js.map +0 -1
- package/esm/integrations/linkederrors.d.ts +0 -40
- package/esm/integrations/linkederrors.d.ts.map +0 -1
- package/esm/integrations/linkederrors.js +0 -63
- package/esm/integrations/linkederrors.js.map +0 -1
- package/esm/integrations/trycatch.d.ts +0 -26
- package/esm/integrations/trycatch.d.ts.map +0 -1
- package/esm/integrations/trycatch.js +0 -164
- package/esm/integrations/trycatch.js.map +0 -1
- package/esm/package.json +0 -52
- package/esm/src/backend.d.ts +0 -41
- package/esm/src/backend.d.ts.map +0 -1
- package/esm/src/backend.js +0 -66
- package/esm/src/backend.js.map +0 -1
- package/esm/src/client.d.ts +0 -55
- package/esm/src/client.d.ts.map +0 -1
- package/esm/src/client.js +0 -49
- package/esm/src/client.js.map +0 -1
- package/esm/src/crossPlatform.d.ts +0 -18
- package/esm/src/crossPlatform.d.ts.map +0 -1
- package/esm/src/crossPlatform.js +0 -77
- package/esm/src/crossPlatform.js.map +0 -1
- package/esm/src/eventbuilder.d.ts +0 -11
- package/esm/src/eventbuilder.d.ts.map +0 -1
- package/esm/src/eventbuilder.js +0 -75
- package/esm/src/eventbuilder.js.map +0 -1
- package/esm/src/flags.d.ts +0 -3
- package/esm/src/flags.d.ts.map +0 -1
- package/esm/src/flags.js +0 -16
- package/esm/src/flags.js.map +0 -1
- package/esm/src/helpers.d.ts +0 -35
- package/esm/src/helpers.d.ts.map +0 -1
- package/esm/src/helpers.js +0 -229
- package/esm/src/helpers.js.map +0 -1
- package/esm/src/index.d.ts +0 -10
- package/esm/src/index.d.ts.map +0 -1
- package/esm/src/index.js +0 -9
- package/esm/src/index.js.map +0 -1
- package/esm/src/integrations/globalhandlers.d.ts +0 -47
- package/esm/src/integrations/globalhandlers.d.ts.map +0 -1
- package/esm/src/integrations/globalhandlers.js +0 -151
- package/esm/src/integrations/globalhandlers.js.map +0 -1
- package/esm/src/integrations/ignoreMpcrawlerErrors.d.ts +0 -21
- package/esm/src/integrations/ignoreMpcrawlerErrors.d.ts.map +0 -1
- package/esm/src/integrations/ignoreMpcrawlerErrors.js +0 -38
- package/esm/src/integrations/ignoreMpcrawlerErrors.js.map +0 -1
- package/esm/src/integrations/index.d.ts +0 -7
- package/esm/src/integrations/index.d.ts.map +0 -1
- package/esm/src/integrations/index.js +0 -7
- package/esm/src/integrations/index.js.map +0 -1
- package/esm/src/integrations/linkederrors.d.ts +0 -40
- package/esm/src/integrations/linkederrors.d.ts.map +0 -1
- package/esm/src/integrations/linkederrors.js +0 -63
- package/esm/src/integrations/linkederrors.js.map +0 -1
- package/esm/src/integrations/router.d.ts +0 -28
- package/esm/src/integrations/router.d.ts.map +0 -1
- package/esm/src/integrations/router.js +0 -45
- package/esm/src/integrations/router.js.map +0 -1
- package/esm/src/integrations/system.d.ts +0 -17
- package/esm/src/integrations/system.d.ts.map +0 -1
- package/esm/src/integrations/system.js +0 -63
- package/esm/src/integrations/system.js.map +0 -1
- package/esm/src/integrations/trycatch.d.ts +0 -26
- package/esm/src/integrations/trycatch.d.ts.map +0 -1
- package/esm/src/integrations/trycatch.js +0 -164
- package/esm/src/integrations/trycatch.js.map +0 -1
- package/esm/src/parsers.d.ts +0 -21
- package/esm/src/parsers.d.ts.map +0 -1
- package/esm/src/parsers.js +0 -91
- package/esm/src/parsers.js.map +0 -1
- package/esm/src/sdk.d.ts +0 -99
- package/esm/src/sdk.d.ts.map +0 -1
- package/esm/src/sdk.js +0 -147
- package/esm/src/sdk.js.map +0 -1
- package/esm/src/tracekit.d.ts +0 -38
- package/esm/src/tracekit.d.ts.map +0 -1
- package/esm/src/tracekit.js +0 -219
- package/esm/src/tracekit.js.map +0 -1
- package/esm/src/transports/base.d.ts +0 -22
- package/esm/src/transports/base.d.ts.map +0 -1
- package/esm/src/transports/base.js +0 -26
- package/esm/src/transports/base.js.map +0 -1
- package/esm/src/transports/index.d.ts +0 -3
- package/esm/src/transports/index.d.ts.map +0 -1
- package/esm/src/transports/index.js +0 -3
- package/esm/src/transports/index.js.map +0 -1
- package/esm/src/transports/xhr.d.ts +0 -10
- package/esm/src/transports/xhr.d.ts.map +0 -1
- package/esm/src/transports/xhr.js +0 -40
- package/esm/src/transports/xhr.js.map +0 -1
- package/esm/src/version.d.ts +0 -3
- package/esm/src/version.d.ts.map +0 -1
- package/esm/src/version.js +0 -4
- package/esm/src/version.js.map +0 -1
- package/esm/transports/base.d.ts +0 -22
- package/esm/transports/base.d.ts.map +0 -1
- package/esm/transports/base.js +0 -26
- package/esm/transports/base.js.map +0 -1
- package/esm/transports/xhr.d.ts +0 -10
- package/esm/transports/xhr.d.ts.map +0 -1
- package/esm/transports/xhr.js +0 -40
- package/esm/transports/xhr.js.map +0 -1
- package/esm/utils/debug-build.d.ts +0 -7
- package/esm/utils/debug-build.d.ts.map +0 -1
- package/esm/utils/debug-build.js +0 -7
- package/esm/utils/debug-build.js.map +0 -1
- package/esm/utils/logger.d.ts +0 -25
- package/esm/utils/logger.d.ts.map +0 -1
- package/esm/utils/logger.js +0 -42
- package/esm/utils/logger.js.map +0 -1
package/esm/client.d.ts
CHANGED
|
@@ -1,55 +1,57 @@
|
|
|
1
|
-
import { BaseClient
|
|
2
|
-
import {
|
|
3
|
-
import { MiniappBackend, MiniappOptions } from "./backend";
|
|
1
|
+
import { BaseClient } from '@sentry/core';
|
|
2
|
+
import type { ClientOptions, Event, EventHint, Scope, SeverityLevel } from '@sentry/core';
|
|
4
3
|
/**
|
|
5
|
-
*
|
|
4
|
+
* Configuration options for the Uniapp SDK.
|
|
6
5
|
*/
|
|
7
|
-
export interface
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
export interface UniappOptions extends ClientOptions {
|
|
7
|
+
/**
|
|
8
|
+
* List of URLs to allow for error tracking.
|
|
9
|
+
*/
|
|
10
|
+
allowUrls?: Array<string | RegExp>;
|
|
11
|
+
/**
|
|
12
|
+
* List of URLs to deny for error tracking.
|
|
13
|
+
*/
|
|
14
|
+
denyUrls?: Array<string | RegExp>;
|
|
15
|
+
/**
|
|
16
|
+
* Extra options for global handlers integration
|
|
17
|
+
*/
|
|
18
|
+
extraOptions?: {
|
|
19
|
+
onerror?: boolean;
|
|
20
|
+
onunhandledrejection?: boolean;
|
|
21
|
+
onpagenotfound?: boolean;
|
|
22
|
+
onmemorywarning?: boolean;
|
|
14
23
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
labelName?: string;
|
|
20
|
-
labelEmail?: string;
|
|
21
|
-
labelComments?: string;
|
|
22
|
-
labelClose?: string;
|
|
23
|
-
labelSubmit?: string;
|
|
24
|
-
errorGeneric?: string;
|
|
25
|
-
errorFormEntry?: string;
|
|
26
|
-
successMessage?: string;
|
|
27
|
-
/** Callback after reportDialog showed up */
|
|
28
|
-
onLoad?(): void;
|
|
24
|
+
/**
|
|
25
|
+
* Enable debug logging
|
|
26
|
+
*/
|
|
27
|
+
debug?: boolean;
|
|
29
28
|
}
|
|
30
29
|
/**
|
|
31
|
-
* The Sentry
|
|
32
|
-
*
|
|
33
|
-
* @see MiniappOptions for documentation on configuration options.
|
|
34
|
-
* @see SentryClient for usage documentation.
|
|
30
|
+
* The Sentry Uniapp SDK Client.
|
|
35
31
|
*/
|
|
36
|
-
export declare class
|
|
32
|
+
export declare class UniappClient extends BaseClient<UniappOptions> {
|
|
37
33
|
/**
|
|
38
|
-
* Creates a new
|
|
39
|
-
*
|
|
40
|
-
* @param options Configuration options for this SDK.
|
|
34
|
+
* Creates a new Uniapp SDK instance.
|
|
41
35
|
*/
|
|
42
|
-
constructor(options
|
|
36
|
+
constructor(options: UniappOptions);
|
|
43
37
|
/**
|
|
44
38
|
* @inheritDoc
|
|
45
39
|
*/
|
|
46
|
-
protected _prepareEvent(event: Event,
|
|
40
|
+
protected _prepareEvent(event: Event, hint: EventHint, scope?: Scope): PromiseLike<Event | null>;
|
|
41
|
+
/**
|
|
42
|
+
* Create an event from an exception.
|
|
43
|
+
*/
|
|
44
|
+
eventFromException(exception: any, hint?: EventHint): PromiseLike<Event>;
|
|
47
45
|
/**
|
|
48
|
-
*
|
|
49
|
-
* 向用户显示报告对话框以将反馈发送到特定事件。---> 小程序上暂时用不到&不考虑。
|
|
50
|
-
*
|
|
51
|
-
* @param options Set individual options for the dialog
|
|
46
|
+
* Create an event from a message.
|
|
52
47
|
*/
|
|
53
|
-
|
|
48
|
+
eventFromMessage(message: string, level?: SeverityLevel, hint?: EventHint): PromiseLike<Event>;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Options for showing the report dialog (not supported in miniapp environment)
|
|
52
|
+
*/
|
|
53
|
+
export interface ReportDialogOptions {
|
|
54
|
+
eventId?: string;
|
|
55
|
+
[key: string]: any;
|
|
54
56
|
}
|
|
55
57
|
//# sourceMappingURL=client.d.ts.map
|
package/esm/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAO1F;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,aAAa;IAClD;;OAEG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAEnC;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAElC;;OAEG;IACH,YAAY,CAAC,EAAE;QACb,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,oBAAoB,CAAC,EAAE,OAAO,CAAC;QAC/B,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,eAAe,CAAC,EAAE,OAAO,CAAC;KAC3B,CAAC;IAEF;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,qBAAa,YAAa,SAAQ,UAAU,CAAC,aAAa,CAAC;IACzD;;OAEG;gBACgB,OAAO,EAAE,aAAa;IAsBzC;;OAEG;IACH,SAAS,CAAC,aAAa,CACrB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,SAAS,EACf,KAAK,CAAC,EAAE,KAAK,GACZ,WAAW,CAAC,KAAK,GAAG,IAAI,CAAC;IAoB5B;;OAEG;IACI,kBAAkB,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC;IAI/E;;OAEG;IACI,gBAAgB,CACrB,OAAO,EAAE,MAAM,EACf,KAAK,GAAE,aAAsB,EAC7B,IAAI,CAAC,EAAE,SAAS,GACf,WAAW,CAAC,KAAK,CAAC;CAGtB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB"}
|
package/esm/client.js
CHANGED
|
@@ -1,52 +1,71 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
// logger is not exported from core in v8, stays in utils or needs check
|
|
2
|
+
// But based on user request, let's check other files.
|
|
3
|
+
// Actually, logger IS internal in v8 usually. Let's keep it if not deprecated or check specifically.
|
|
4
|
+
// User specifically mentioned extractExceptionKeysForMessage, isEvent, normalizeToSize.
|
|
5
|
+
// Let's stick to those for now, and check if logger is deprecated.
|
|
6
|
+
import { BaseClient } from '@sentry/core';
|
|
7
|
+
import { eventFromException, eventFromMessage } from './eventbuilder';
|
|
8
|
+
import { makeUniappTransport } from './transport';
|
|
9
|
+
import { SDK_NAME, SDK_VERSION } from './version';
|
|
10
|
+
import { debugLog, debugError } from './debug';
|
|
5
11
|
/**
|
|
6
|
-
* The Sentry
|
|
7
|
-
*
|
|
8
|
-
* @see MiniappOptions for documentation on configuration options.
|
|
9
|
-
* @see SentryClient for usage documentation.
|
|
12
|
+
* The Sentry Uniapp SDK Client.
|
|
10
13
|
*/
|
|
11
|
-
|
|
12
|
-
__extends(MiniappClient, _super);
|
|
14
|
+
export class UniappClient extends BaseClient {
|
|
13
15
|
/**
|
|
14
|
-
* Creates a new
|
|
15
|
-
*
|
|
16
|
-
* @param options Configuration options for this SDK.
|
|
16
|
+
* Creates a new Uniapp SDK instance.
|
|
17
17
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
constructor(options) {
|
|
19
|
+
debugLog('[Sentry Client] Constructor called');
|
|
20
|
+
debugLog('[Sentry Client] options.dsn:', options.dsn);
|
|
21
|
+
debugLog('[Sentry Client] options.transport:', typeof options.transport);
|
|
22
|
+
// Set default transport if not provided
|
|
23
|
+
const clientOptions = {
|
|
24
|
+
transport: makeUniappTransport,
|
|
25
|
+
...options,
|
|
26
|
+
};
|
|
27
|
+
debugLog('[Sentry Client] Calling super(options)...');
|
|
28
|
+
try {
|
|
29
|
+
super(clientOptions);
|
|
30
|
+
debugLog('[Sentry Client] super() completed successfully!');
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
debugError('[Sentry Client] super() threw error:', error);
|
|
34
|
+
throw error;
|
|
35
|
+
}
|
|
36
|
+
debugLog('[Sentry Client] Constructor complete');
|
|
21
37
|
}
|
|
22
38
|
/**
|
|
23
39
|
* @inheritDoc
|
|
24
40
|
*/
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
41
|
+
_prepareEvent(event, hint, scope) {
|
|
42
|
+
debugLog('[Sentry Client] _prepareEvent called for event:', event.event_id);
|
|
43
|
+
debugLog('[Sentry Client] Event type:', event.type);
|
|
44
|
+
debugLog('[Sentry Client] Event message:', event.message);
|
|
45
|
+
// Set SDK info
|
|
46
|
+
event.sdk = {
|
|
47
|
+
name: SDK_NAME,
|
|
48
|
+
packages: [
|
|
28
49
|
{
|
|
29
|
-
name:
|
|
30
|
-
version: SDK_VERSION
|
|
31
|
-
}
|
|
32
|
-
]
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
// }
|
|
50
|
+
name: 'npm:sentry-uniapp',
|
|
51
|
+
version: SDK_VERSION,
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
version: SDK_VERSION,
|
|
55
|
+
};
|
|
56
|
+
return super._prepareEvent(event, hint, scope);
|
|
57
|
+
}
|
|
38
58
|
/**
|
|
39
|
-
*
|
|
40
|
-
* 向用户显示报告对话框以将反馈发送到特定事件。---> 小程序上暂时用不到&不考虑。
|
|
41
|
-
*
|
|
42
|
-
* @param options Set individual options for the dialog
|
|
59
|
+
* Create an event from an exception.
|
|
43
60
|
*/
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
61
|
+
eventFromException(exception, hint) {
|
|
62
|
+
return Promise.resolve(eventFromException(exception, hint));
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Create an event from a message.
|
|
66
|
+
*/
|
|
67
|
+
eventFromMessage(message, level = 'info', hint) {
|
|
68
|
+
return Promise.resolve(eventFromMessage(message, level, hint));
|
|
69
|
+
}
|
|
70
|
+
}
|
|
52
71
|
//# sourceMappingURL=client.js.map
|
package/esm/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,uDAAuD;AACvD,qGAAqG;AACrG,wFAAwF;AACxF,mEAAmE;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAgC/C;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,UAAyB;IACzD;;OAEG;IACH,YAAmB,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E,IAAI,CAAC,CAAC,CAAC;IAC9D,CAAC;IAED;;OAEG;IACI,gBAAgB,CACrB,OAAe,EACf,QAAuB,MAAM,EAC7B,IAAgB;QAEhB,OAAO,OAAO,CAAC,OAAO,CAAC,gBAAgB,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;IACjE,CAAC;CACF"}
|
package/esm/crossPlatform.d.ts
CHANGED
|
@@ -13,6 +13,6 @@ interface SDK {
|
|
|
13
13
|
getLaunchOptionsSync?: Function;
|
|
14
14
|
}
|
|
15
15
|
declare const sdk: SDK;
|
|
16
|
-
declare const appName: "
|
|
16
|
+
declare const appName: "uniapp" | "wechat" | "alipay" | "bytedance" | "dingtalk" | "qq" | "swan" | "unknown";
|
|
17
17
|
export { sdk, appName };
|
|
18
18
|
//# sourceMappingURL=crossPlatform.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crossPlatform.d.ts","sourceRoot":"","sources":["../src/crossPlatform.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"crossPlatform.d.ts","sourceRoot":"","sources":["../src/crossPlatform.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,UAAU,GAAG;IACX,OAAO,EAAE,QAAQ,CAAC;IAClB,WAAW,CAAC,EAAE,QAAQ,CAAC;IACvB,aAAa,EAAE,QAAQ,CAAC;IACxB,iBAAiB,EAAE,QAAQ,CAAC;IAC5B,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,oBAAoB,CAAC,EAAE,QAAQ,CAAC;IAChC,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,eAAe,CAAC,EAAE,QAAQ,CAAC;IAC3B,oBAAoB,CAAC,EAAE,QAAQ,CAAC;CACjC;AAiGD,QAAA,MAAM,GAAG,KAAW,CAAC;AACrB,QAAA,MAAM,OAAO,uFAAe,CAAC;AAE7B,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC"}
|
package/esm/crossPlatform.js
CHANGED
|
@@ -1,53 +1,68 @@
|
|
|
1
|
-
|
|
1
|
+
import { debugLog, debugError } from './debug';
|
|
2
|
+
let currentSdk = {
|
|
2
3
|
// tslint:disable-next-line: no-empty
|
|
3
|
-
request:
|
|
4
|
+
request: () => {
|
|
4
5
|
},
|
|
5
6
|
// tslint:disable-next-line: no-empty
|
|
6
|
-
httpRequest:
|
|
7
|
+
httpRequest: () => {
|
|
7
8
|
},
|
|
8
9
|
// tslint:disable-next-line: no-empty
|
|
9
|
-
getSystemInfoSync:
|
|
10
|
+
getSystemInfoSync: () => {
|
|
10
11
|
},
|
|
11
12
|
// tslint:disable-next-line: no-empty
|
|
12
|
-
getSystemInfo:
|
|
13
|
+
getSystemInfo: () => {
|
|
13
14
|
},
|
|
14
15
|
};
|
|
15
16
|
/**
|
|
16
17
|
* 获取跨平台的 SDK
|
|
17
18
|
*/
|
|
18
|
-
|
|
19
|
+
const getSDK = () => {
|
|
20
|
+
debugLog('[Sentry CrossPlatform] Detecting platform...');
|
|
21
|
+
debugLog('[Sentry CrossPlatform] typeof uni:', typeof uni);
|
|
22
|
+
debugLog('[Sentry CrossPlatform] typeof wx:', typeof wx);
|
|
19
23
|
if (typeof uni === "object") {
|
|
24
|
+
debugLog('[Sentry CrossPlatform] Using uni SDK');
|
|
25
|
+
debugLog('[Sentry CrossPlatform] uni.request available:', typeof uni.request);
|
|
20
26
|
currentSdk = uni;
|
|
21
27
|
}
|
|
22
28
|
else if (typeof wx === "object") {
|
|
29
|
+
debugLog('[Sentry CrossPlatform] Using wx SDK');
|
|
30
|
+
debugLog('[Sentry CrossPlatform] wx.request available:', typeof wx.request);
|
|
23
31
|
currentSdk = wx;
|
|
24
32
|
}
|
|
25
33
|
else if (typeof my === "object") {
|
|
34
|
+
debugLog('[Sentry CrossPlatform] Using my SDK');
|
|
26
35
|
currentSdk = my;
|
|
27
36
|
}
|
|
28
37
|
else if (typeof tt === "object") {
|
|
38
|
+
debugLog('[Sentry CrossPlatform] Using tt SDK');
|
|
29
39
|
currentSdk = tt;
|
|
30
40
|
}
|
|
31
41
|
else if (typeof dd === "object") {
|
|
42
|
+
debugLog('[Sentry CrossPlatform] Using dd SDK');
|
|
32
43
|
currentSdk = dd;
|
|
33
44
|
}
|
|
34
45
|
else if (typeof qq === "object") {
|
|
46
|
+
debugLog('[Sentry CrossPlatform] Using qq SDK');
|
|
35
47
|
currentSdk = qq;
|
|
36
48
|
}
|
|
37
49
|
else if (typeof swan === "object") {
|
|
50
|
+
debugLog('[Sentry CrossPlatform] Using swan SDK');
|
|
38
51
|
currentSdk = swan;
|
|
39
52
|
}
|
|
40
53
|
else {
|
|
54
|
+
debugError('[Sentry CrossPlatform] No supported platform detected!');
|
|
41
55
|
// tslint:disable-next-line:no-console
|
|
42
56
|
console.log("sentry-uniapp 暂不支持此平台, 快应用请使用 sentry-quickapp");
|
|
43
57
|
}
|
|
58
|
+
debugLog('[Sentry CrossPlatform] Final SDK.request type:', typeof currentSdk.request);
|
|
44
59
|
return currentSdk;
|
|
45
60
|
};
|
|
46
61
|
/**
|
|
47
62
|
* 获取平台名称
|
|
48
63
|
*/
|
|
49
|
-
|
|
50
|
-
|
|
64
|
+
const getAppName = () => {
|
|
65
|
+
let currentAppName = "unknown";
|
|
51
66
|
if (typeof uni === "object") {
|
|
52
67
|
currentAppName = "uniapp";
|
|
53
68
|
}
|
|
@@ -71,7 +86,7 @@ var getAppName = function () {
|
|
|
71
86
|
}
|
|
72
87
|
return currentAppName;
|
|
73
88
|
};
|
|
74
|
-
|
|
75
|
-
|
|
89
|
+
const sdk = getSDK();
|
|
90
|
+
const appName = getAppName();
|
|
76
91
|
export { sdk, appName };
|
|
77
92
|
//# sourceMappingURL=crossPlatform.js.map
|
package/esm/crossPlatform.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crossPlatform.js","sourceRoot":"","sources":["../src/crossPlatform.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"crossPlatform.js","sour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AE,CAAC;QAClC,cAAc,GAAG,IAAI,CAAC;IACxB,CAAC;SAAM,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QACpC,cAAc,GAAG,MAAM,CAAC;IAC1B,CAAC;IAED,OAAO,cAAc,CAAC;AACxB,CAAC,CAAC;AAEF,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;AACrB,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;AAE7B,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC"}
|
package/esm/debug.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../src/debug.ts"],"names":[],"mappings":"AAKA,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAEtD;AAED,wBAAgB,QAAQ,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAI7C;AAED,wBAAgB,UAAU,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAI/C"}
|
package/esm/debug.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Debug logger utility
|
|
3
|
+
*/
|
|
4
|
+
let debugEnabled = false;
|
|
5
|
+
export function setDebugEnabled(enabled) {
|
|
6
|
+
debugEnabled = enabled;
|
|
7
|
+
}
|
|
8
|
+
export function debugLog(...args) {
|
|
9
|
+
if (debugEnabled) {
|
|
10
|
+
console.log(...args);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export function debugError(...args) {
|
|
14
|
+
if (debugEnabled) {
|
|
15
|
+
console.error(...args);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=debug.js.map
|
package/esm/debug.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug.js","sourceRoot":"","sources":["../src/debug.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,IAAI,YAAY,GAAG,KAAK,CAAC;AAEzB,MAAM,UAAU,eAAe,CAAC,OAAgB;IAC5C,YAAY,GAAG,OAAO,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,GAAG,IAAW;IACnC,IAAI,YAAY,EAAE,CAAC;QACf,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;IACzB,CAAC;AACL,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,GAAG,IAAW;IACrC,IAAI,YAAY,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;IAC3B,CAAC;AACL,CAAC"}
|
package/esm/eventbuilder.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { Event } from '@sentry/
|
|
2
|
-
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}): Event;
|
|
1
|
+
import type { Event, EventHint, SeverityLevel } from '@sentry/core';
|
|
2
|
+
/**
|
|
3
|
+
* Builds an Event from an Exception
|
|
4
|
+
*/
|
|
5
|
+
export declare function eventFromException(exception: unknown, hint?: EventHint): Event;
|
|
6
|
+
/**
|
|
7
|
+
* Builds an Event from a Message
|
|
8
|
+
*/
|
|
9
|
+
export declare function eventFromMessage(message: string, level?: SeverityLevel, hint?: EventHint): Event;
|
|
11
10
|
//# sourceMappingURL=eventbuilder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eventbuilder.d.ts","sourceRoot":"","sources":["../src/eventbuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"eventbuilder.d.ts","sourceRoot":"","sources":["../src/eventbuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAa,aAAa,EAAc,MAAM,cAAc,CAAC;AAM3F;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,KAAK,CAkB9E;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EACf,KAAK,GAAE,aAAsB,EAC7B,IAAI,CAAC,EAAE,SAAS,GACf,KAAK,CAaP"}
|
package/esm/eventbuilder.js
CHANGED
|
@@ -1,75 +1,148 @@
|
|
|
1
|
-
import { addExceptionMechanism, addExceptionTypeValue,
|
|
2
|
-
import {
|
|
1
|
+
import { addExceptionMechanism, addExceptionTypeValue, extractExceptionKeysForMessage, normalizeToSize } from '@sentry/core';
|
|
2
|
+
import { exceptionFromStacktrace } from './parsers';
|
|
3
3
|
import { computeStackTrace } from './tracekit';
|
|
4
|
-
/**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Builds an Event from an Exception
|
|
6
|
+
*/
|
|
7
|
+
export function eventFromException(exception, hint) {
|
|
8
|
+
const syntheticException = (hint && hint.syntheticException) || undefined;
|
|
9
|
+
const event = eventFromUnknownInput(exception, syntheticException, {
|
|
10
|
+
attachStacktrace: hint === null || hint === void 0 ? void 0 : hint.attachStacktrace,
|
|
11
|
+
});
|
|
12
|
+
addExceptionMechanism(event, {
|
|
13
|
+
handled: true,
|
|
14
|
+
type: 'generic',
|
|
15
|
+
});
|
|
16
|
+
event.level = 'error';
|
|
17
|
+
if (hint && hint.event_id) {
|
|
18
|
+
event.event_id = hint.event_id;
|
|
14
19
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
return event;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Builds an Event from a Message
|
|
24
|
+
*/
|
|
25
|
+
export function eventFromMessage(message, level = 'info', hint) {
|
|
26
|
+
const syntheticException = (hint && hint.syntheticException) || undefined;
|
|
27
|
+
const event = eventFromString(message, syntheticException, {
|
|
28
|
+
attachStacktrace: hint === null || hint === void 0 ? void 0 : hint.attachStacktrace,
|
|
29
|
+
});
|
|
30
|
+
event.level = level;
|
|
31
|
+
if (hint && hint.event_id) {
|
|
32
|
+
event.event_id = hint.event_id;
|
|
33
|
+
}
|
|
34
|
+
return event;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Builds an Event from an unknown input
|
|
38
|
+
*/
|
|
39
|
+
function eventFromUnknownInput(exception, syntheticException, options = {}) {
|
|
40
|
+
let event;
|
|
41
|
+
// Check if it's an ErrorEvent
|
|
42
|
+
if (typeof exception === 'object' && exception !== null && 'error' in exception) {
|
|
43
|
+
const errorEvent = exception;
|
|
44
|
+
if (errorEvent.error) {
|
|
45
|
+
exception = errorEvent.error;
|
|
46
|
+
}
|
|
26
47
|
}
|
|
27
|
-
if
|
|
28
|
-
|
|
29
|
-
event = eventFromStacktrace(
|
|
48
|
+
// Check if it's an Error
|
|
49
|
+
if (exception instanceof Error) {
|
|
50
|
+
event = eventFromStacktrace(exception);
|
|
30
51
|
return event;
|
|
31
52
|
}
|
|
32
|
-
if
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
var objectException = exception;
|
|
37
|
-
event = eventFromPlainObject(objectException, syntheticException, options.rejection);
|
|
53
|
+
// Check if it's a plain object
|
|
54
|
+
if (typeof exception === 'object' && exception !== null) {
|
|
55
|
+
const objectException = exception;
|
|
56
|
+
event = eventFromPlainObject(objectException, syntheticException);
|
|
38
57
|
addExceptionMechanism(event, {
|
|
39
58
|
synthetic: true,
|
|
40
59
|
});
|
|
41
60
|
return event;
|
|
42
61
|
}
|
|
43
|
-
//
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
// - an instance of Event
|
|
47
|
-
// - an instance of Error
|
|
48
|
-
// - a valid ErrorEvent (one with an error property)
|
|
49
|
-
// - a plain Object
|
|
50
|
-
//
|
|
51
|
-
// So bail out and capture it as a simple message:
|
|
52
|
-
event = eventFromString(exception, syntheticException, options);
|
|
53
|
-
addExceptionTypeValue(event, "" + exception, undefined);
|
|
62
|
+
// For everything else, treat as string
|
|
63
|
+
event = eventFromString(String(exception), syntheticException, options);
|
|
64
|
+
addExceptionTypeValue(event, String(exception), undefined);
|
|
54
65
|
addExceptionMechanism(event, {
|
|
55
66
|
synthetic: true,
|
|
56
67
|
});
|
|
57
68
|
return event;
|
|
58
69
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
70
|
+
/**
|
|
71
|
+
* Create event from string
|
|
72
|
+
*/
|
|
73
|
+
function eventFromString(input, syntheticException, options = {}) {
|
|
74
|
+
const event = {
|
|
64
75
|
message: input,
|
|
65
76
|
};
|
|
66
77
|
if (options.attachStacktrace && syntheticException) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
event.
|
|
70
|
-
|
|
78
|
+
const stacktrace = computeStackTrace(syntheticException);
|
|
79
|
+
const frames = prepareFramesForEvent(stacktrace.stack);
|
|
80
|
+
event.exception = {
|
|
81
|
+
values: [
|
|
82
|
+
{
|
|
83
|
+
value: input,
|
|
84
|
+
stacktrace: frames.length ? { frames: frames.reverse() } : undefined,
|
|
85
|
+
},
|
|
86
|
+
],
|
|
71
87
|
};
|
|
72
88
|
}
|
|
73
89
|
return event;
|
|
74
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* Create event from stacktrace
|
|
93
|
+
*/
|
|
94
|
+
function eventFromStacktrace(exception) {
|
|
95
|
+
const stacktrace = computeStackTrace(exception);
|
|
96
|
+
const exceptionData = exceptionFromStacktrace(stacktrace);
|
|
97
|
+
const event = {
|
|
98
|
+
exception: {
|
|
99
|
+
values: [exceptionData],
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
return event;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Create event from plain object
|
|
106
|
+
*/
|
|
107
|
+
function eventFromPlainObject(exception, syntheticException) {
|
|
108
|
+
var _a, _b;
|
|
109
|
+
const message = `Non-Error exception captured with keys: ${extractExceptionKeysForMessage(exception)}`;
|
|
110
|
+
const event = {
|
|
111
|
+
exception: {
|
|
112
|
+
values: [
|
|
113
|
+
{
|
|
114
|
+
type: 'Error',
|
|
115
|
+
value: message,
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
},
|
|
119
|
+
extra: {
|
|
120
|
+
__serialized__: normalizeToSize(exception),
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
if (syntheticException) {
|
|
124
|
+
const stacktrace = computeStackTrace(syntheticException);
|
|
125
|
+
const frames = prepareFramesForEvent(stacktrace.stack);
|
|
126
|
+
if ((_b = (_a = event.exception) === null || _a === void 0 ? void 0 : _a.values) === null || _b === void 0 ? void 0 : _b[0]) {
|
|
127
|
+
event.exception.values[0].stacktrace = frames.length
|
|
128
|
+
? { frames: frames.reverse() }
|
|
129
|
+
: undefined;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return event;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Prepare frames for event
|
|
136
|
+
*/
|
|
137
|
+
function prepareFramesForEvent(stack) {
|
|
138
|
+
if (!stack || !stack.length) {
|
|
139
|
+
return [];
|
|
140
|
+
}
|
|
141
|
+
return stack.map((frame) => ({
|
|
142
|
+
filename: frame.url,
|
|
143
|
+
function: frame.func || '?',
|
|
144
|
+
lineno: frame.line,
|
|
145
|
+
colno: frame.column,
|
|
146
|
+
}));
|
|
147
|
+
}
|
|
75
148
|
//# sourceMappingURL=eventbuilder.js.map
|