@goliapkg/sentori-vue 0.1.0 → 0.1.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.
- package/lib/ErrorBoundary.d.ts.map +1 -1
- package/lib/ErrorBoundary.js +4 -1
- package/lib/ErrorBoundary.js.map +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +6 -1
- package/lib/index.js.map +1 -1
- package/package.json +3 -3
- package/src/ErrorBoundary.ts +4 -1
- package/src/index.ts +6 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../src/ErrorBoundary.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../src/ErrorBoundary.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,oBAAoB;IAG7B;sDACkD;;cACzB,MAAM,SAAS,MAAM,EAAE;;;;;;;;IAFhD;sDACkD;;cACzB,MAAM,SAAS,MAAM,EAAE;;;;;4EAiClD,CAAA"}
|
package/lib/ErrorBoundary.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
// stop the error from propagating. Our wrapper captures into
|
|
7
7
|
// Sentori and renders either the slot's children or a `fallback`
|
|
8
8
|
// slot when the subtree threw.
|
|
9
|
+
import { coerceError } from '@goliapkg/sentori-core';
|
|
9
10
|
import { captureException } from '@goliapkg/sentori-javascript';
|
|
10
11
|
import { defineComponent, h, ref } from 'vue';
|
|
11
12
|
export const SentoriErrorBoundary = defineComponent({
|
|
@@ -34,7 +35,9 @@ export const SentoriErrorBoundary = defineComponent({
|
|
|
34
35
|
};
|
|
35
36
|
},
|
|
36
37
|
errorCaptured(err, _instance, info) {
|
|
37
|
-
|
|
38
|
+
// `coerceError` JSON-stringifies plain-object throws so the
|
|
39
|
+
// dashboard shows the real payload instead of `[object Object]`.
|
|
40
|
+
const e = coerceError(err);
|
|
38
41
|
if (this.ignore.includes(e.name)) {
|
|
39
42
|
return true; // propagate further
|
|
40
43
|
}
|
package/lib/ErrorBoundary.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundary.js","sourceRoot":"","sources":["../src/ErrorBoundary.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,EAAE;AACF,8DAA8D;AAC9D,6DAA6D;AAC7D,gEAAgE;AAChE,6DAA6D;AAC7D,iEAAiE;AACjE,+BAA+B;AAE/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAC/D,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAE7C,MAAM,CAAC,MAAM,oBAAoB,GAAG,eAAe,CAAC;IAClD,IAAI,EAAE,sBAAsB;IAC5B,KAAK,EAAE;QACL;0DACkD;QAClD,MAAM,EAAE,EAAE,IAAI,EAAE,KAAgC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE;KACtE;IACD,KAAK,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE;QACrB,MAAM,WAAW,GAAG,GAAG,CAAe,IAAI,CAAC,CAAA;QAC3C,MAAM,KAAK,GAAG,GAAG,EAAE;YACjB,WAAW,CAAC,KAAK,GAAG,IAAI,CAAA;QAC1B,CAAC,CAAA;QACD,OAAO,GAAG,EAAE;YACV,IAAI,WAAW,CAAC,KAAK,EAAE,CAAC;gBACtB,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;oBACnB,OAAO,KAAK,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,CAAA;gBAC5D,CAAC;gBACD,0DAA0D;gBAC1D,0DAA0D;gBAC1D,6BAA6B;gBAC7B,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,6BAA6B,EAAE,MAAM,EAAE,CAAC,CAAA;YAC7D,CAAC;YACD,OAAO,KAAK,CAAC,O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,EAAE,CAAC,CAAA;YAC7D,CAAC;YACD,OAAO,KAAK,CAAC,OAAO,EAAE,EAAE,CAAA;QAC1B,CAAC,CAAA;IACH,CAAC;IACD,aAAa,CAAC,GAAG,EAAE,SAAS,EAAE,IAAI;QAChC,4DAA4D;QAC5D,iEAAiE;QACjE,MAAM,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,CAAA;QAC1B,IAAK,IAAI,CAAC,MAA4B,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;YACxD,OAAO,IAAI,CAAA,CAAC,oBAAoB;QAClC,CAAC;QACD,gBAAgB,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;QACxD,kDAAkD;QAClD,IAAI,CAAC,YAAY,EAAE,CAClB;QAAC,IAA4D,CAAC,WAAW,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,CAAA;QACzF,OAAO,KAAK,CAAA;IACd,CAAC;CACF,CAAC,CAAA"}
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAO,MAAM,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAO,MAAM,EAAE,MAAM,KAAK,CAAA;AAEtC,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,8BAA8B,CAAA;AAErC,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAA;AAE3C,QAAA,MAAM,MAAM,EAAE,MAyBb,CAAA;AAED,eAAe,MAAM,CAAA;AACrB,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,CAAA;AAE5B,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,gBAAgB,IAAI,YAAY,EAChC,WAAW,EACX,OAAO,EACP,OAAO,GACR,MAAM,8BAA8B,CAAA;AAErC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA"}
|
package/lib/index.js
CHANGED
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
* import { setupTraceNavigation } from '@goliapkg/sentori-vue/router'
|
|
26
26
|
* setupTraceNavigation(router)
|
|
27
27
|
*/
|
|
28
|
+
import { coerceError } from '@goliapkg/sentori-core';
|
|
28
29
|
import { captureException as captureExceptionJs, initSentori as initSentoriJs, } from '@goliapkg/sentori-javascript';
|
|
29
30
|
const plugin = {
|
|
30
31
|
install(app, options) {
|
|
@@ -35,7 +36,11 @@ const plugin = {
|
|
|
35
36
|
// non-Error values so the SDK still gets a stack.
|
|
36
37
|
const previous = app.config.errorHandler;
|
|
37
38
|
app.config.errorHandler = (err, instance, info) => {
|
|
38
|
-
|
|
39
|
+
// `coerceError` JSON-stringifies plain-object throws — Vue's
|
|
40
|
+
// errorHandler regularly sees non-Error values from user code
|
|
41
|
+
// (`throw {code: 'auth/expired'}`). Without it those collapse to
|
|
42
|
+
// the literal text `[object Object]` in the dashboard.
|
|
43
|
+
const e = coerceError(err);
|
|
39
44
|
captureExceptionJs(e, {
|
|
40
45
|
tags: {
|
|
41
46
|
'vue.component': instance?.$options?.name ?? '<anonymous>',
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,OAAO,EACL,gBAAgB,IAAI,kBAAkB,EACtC,WAAW,IAAI,aAAa,GAE7B,MAAM,8BAA8B,CAAA;AAIrC,MAAM,MAAM,GAAW;IACrB,OAAO,CAAC,GAAQ,EAAE,OAA0B;QAC1C,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CACF,CAAA;AAED,eAAe,MAAM,CAAA;AACrB,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,CAAA;AAE5B,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,gBAAgB,IAAI,YAAY,EAChC,WAAW,EACX,OAAO,EACP,OAAO,GACR,MAAM,8BAA8B,CAAA;AAErC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goliapkg/sentori-vue",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Vue 3 adapter for Sentori — plugin, errorHandler hook, Vue Router auto-trace navigation, <SentoriErrorBoundary>.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://sentori.golia.jp",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@goliapkg/sentori-core": "0.
|
|
57
|
-
"@goliapkg/sentori-javascript": "0.4.
|
|
56
|
+
"@goliapkg/sentori-core": "0.7.0",
|
|
57
|
+
"@goliapkg/sentori-javascript": "0.4.2"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@types/bun": "latest",
|
package/src/ErrorBoundary.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
// Sentori and renders either the slot's children or a `fallback`
|
|
8
8
|
// slot when the subtree threw.
|
|
9
9
|
|
|
10
|
+
import { coerceError } from '@goliapkg/sentori-core'
|
|
10
11
|
import { captureException } from '@goliapkg/sentori-javascript'
|
|
11
12
|
import { defineComponent, h, ref } from 'vue'
|
|
12
13
|
|
|
@@ -36,7 +37,9 @@ export const SentoriErrorBoundary = defineComponent({
|
|
|
36
37
|
}
|
|
37
38
|
},
|
|
38
39
|
errorCaptured(err, _instance, info) {
|
|
39
|
-
|
|
40
|
+
// `coerceError` JSON-stringifies plain-object throws so the
|
|
41
|
+
// dashboard shows the real payload instead of `[object Object]`.
|
|
42
|
+
const e = coerceError(err)
|
|
40
43
|
if ((this.ignore as readonly string[]).includes(e.name)) {
|
|
41
44
|
return true // propagate further
|
|
42
45
|
}
|
package/src/index.ts
CHANGED
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
*/
|
|
28
28
|
|
|
29
29
|
import type { App, Plugin } from 'vue'
|
|
30
|
+
import { coerceError } from '@goliapkg/sentori-core'
|
|
30
31
|
import {
|
|
31
32
|
captureException as captureExceptionJs,
|
|
32
33
|
initSentori as initSentoriJs,
|
|
@@ -45,7 +46,11 @@ const plugin: Plugin = {
|
|
|
45
46
|
// non-Error values so the SDK still gets a stack.
|
|
46
47
|
const previous = app.config.errorHandler
|
|
47
48
|
app.config.errorHandler = (err, instance, info) => {
|
|
48
|
-
|
|
49
|
+
// `coerceError` JSON-stringifies plain-object throws — Vue's
|
|
50
|
+
// errorHandler regularly sees non-Error values from user code
|
|
51
|
+
// (`throw {code: 'auth/expired'}`). Without it those collapse to
|
|
52
|
+
// the literal text `[object Object]` in the dashboard.
|
|
53
|
+
const e = coerceError(err)
|
|
49
54
|
captureExceptionJs(e, {
|
|
50
55
|
tags: {
|
|
51
56
|
'vue.component': instance?.$options?.name ?? '<anonymous>',
|