start-slicemachine 0.12.68-beta.2 → 0.12.68
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/dist/lib/sentryErrorHandlers.cjs +1 -1
- package/dist/lib/sentryErrorHandlers.cjs.map +1 -1
- package/dist/lib/sentryErrorHandlers.js +2 -2
- package/dist/lib/sentryErrorHandlers.js.map +1 -1
- package/dist/packages/start-slicemachine/package.json.cjs +1 -1
- package/dist/packages/start-slicemachine/package.json.js +1 -1
- package/package.json +3 -4
- package/src/lib/sentryErrorHandlers.ts +6 -2
|
@@ -4,7 +4,7 @@ const manager = require("@slicemachine/manager");
|
|
|
4
4
|
const exports$1 = require('./../_node_modules/@sentry/node/_node_modules/@sentry/core/esm/exports.cjs');
|
|
5
5
|
const node = (name, error) => {
|
|
6
6
|
{
|
|
7
|
-
if (error instanceof manager.UnauthenticatedError || error instanceof manager.UnauthorizedError) ;
|
|
7
|
+
if (error instanceof manager.UnauthenticatedError || error instanceof manager.UnauthorizedError || error instanceof manager.InferSliceAbortError) ;
|
|
8
8
|
else {
|
|
9
9
|
exports$1.withScope(function(scope) {
|
|
10
10
|
scope.setTransactionName(name);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sentryErrorHandlers.cjs","sources":["../../../src/lib/sentryErrorHandlers.ts"],"sourcesContent":["import type { ErrorRequestHandler } from \"express\";\nimport * as Sentry from \"@sentry/node\";\n\nimport {\n\tCreateSliceMachineManagerMiddlewareArgs,\n\tUnauthenticatedError,\n\tUnauthorizedError,\n} from \"@slicemachine/manager\";\n\nimport { checkIsSentryEnabled } from \"./checkIsSentryEnabled\";\n\nexport const node = (name: string, error: unknown): void => {\n\tif (checkIsSentryEnabled()) {\n\t\tif (\n\t\t\terror instanceof UnauthenticatedError ||\n\t\t\terror instanceof UnauthorizedError\n\t\t) {\n\t\t\t// noop - User is not logged in or does not have access to the repository
|
|
1
|
+
{"version":3,"file":"sentryErrorHandlers.cjs","sources":["../../../src/lib/sentryErrorHandlers.ts"],"sourcesContent":["import type { ErrorRequestHandler } from \"express\";\nimport * as Sentry from \"@sentry/node\";\n\nimport {\n\tCreateSliceMachineManagerMiddlewareArgs,\n\tUnauthenticatedError,\n\tUnauthorizedError,\n\tInferSliceAbortError,\n} from \"@slicemachine/manager\";\n\nimport { checkIsSentryEnabled } from \"./checkIsSentryEnabled\";\n\nexport const node = (name: string, error: unknown): void => {\n\tif (checkIsSentryEnabled()) {\n\t\tif (\n\t\t\terror instanceof UnauthenticatedError ||\n\t\t\terror instanceof UnauthorizedError ||\n\t\t\terror instanceof InferSliceAbortError\n\t\t) {\n\t\t\t// noop - No need to track this error in Sentry.\n\t\t\t// 1. User is not logged in or does not have access to the repository\n\t\t\t// 2. Infer slice was aborted by the user, not an error\n\t\t} else {\n\t\t\tSentry.withScope(function (scope) {\n\t\t\t\tscope.setTransactionName(name);\n\t\t\t\tSentry.captureException(error, {\n\t\t\t\t\t...(error instanceof Error ? { extra: { cause: error.cause } } : {}),\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n};\n\nexport const server: ErrorRequestHandler = (error, req, _res, next): void => {\n\tnode(req.path, error);\n\tnext();\n};\n\nexport const rpc: CreateSliceMachineManagerMiddlewareArgs[\"onError\"] = (\n\targs,\n) => {\n\tnode(args.procedurePath.join(\".\"), args.error);\n};\n"],"names":["UnauthenticatedError","UnauthorizedError","InferSliceAbortError","Sentry.withScope","Sentry.captureException"],"mappings":";;;;AAYO,MAAM,OAAO,CAAC,MAAc,UAAwB;AAC9B;AAC3B,QACC,iBAAiBA,QAAAA,wBACjB,iBAAiBC,QAAAA,qBACjB,iBAAiBC,QAAAA,qBAChB;AAAA,SAIK;AACNC,gBAAAA,UAAiB,SAAU,OAAK;AAC/B,cAAM,mBAAmB,IAAI;AAC7BC,kBAAAA,iBAAwB,OAAO;AAAA,UAC9B,GAAI,iBAAiB,QAAQ,EAAE,OAAO,EAAE,OAAO,MAAM,MAAA,MAAY,CAAA;AAAA,QAAA,CACjE;AAAA,MACF,CAAC;AAAA,IACF;AAAA,EACD;AACD;AAEO,MAAM,SAA8B,CAAC,OAAO,KAAK,MAAM,SAAc;AAC3E,OAAK,IAAI,MAAM,KAAK;AACpB,OAAA;AACD;AAEO,MAAM,MAA0D,CACtE,SACG;AACH,OAAK,KAAK,cAAc,KAAK,GAAG,GAAG,KAAK,KAAK;AAC9C;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { UnauthenticatedError, UnauthorizedError } from "@slicemachine/manager";
|
|
1
|
+
import { UnauthenticatedError, UnauthorizedError, InferSliceAbortError } from "@slicemachine/manager";
|
|
2
2
|
import { withScope, captureException } from './../_node_modules/@sentry/node/_node_modules/@sentry/core/esm/exports.js';
|
|
3
3
|
const node = (name, error) => {
|
|
4
4
|
{
|
|
5
|
-
if (error instanceof UnauthenticatedError || error instanceof UnauthorizedError) ;
|
|
5
|
+
if (error instanceof UnauthenticatedError || error instanceof UnauthorizedError || error instanceof InferSliceAbortError) ;
|
|
6
6
|
else {
|
|
7
7
|
withScope(function(scope) {
|
|
8
8
|
scope.setTransactionName(name);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sentryErrorHandlers.js","sources":["../../../src/lib/sentryErrorHandlers.ts"],"sourcesContent":["import type { ErrorRequestHandler } from \"express\";\nimport * as Sentry from \"@sentry/node\";\n\nimport {\n\tCreateSliceMachineManagerMiddlewareArgs,\n\tUnauthenticatedError,\n\tUnauthorizedError,\n} from \"@slicemachine/manager\";\n\nimport { checkIsSentryEnabled } from \"./checkIsSentryEnabled\";\n\nexport const node = (name: string, error: unknown): void => {\n\tif (checkIsSentryEnabled()) {\n\t\tif (\n\t\t\terror instanceof UnauthenticatedError ||\n\t\t\terror instanceof UnauthorizedError\n\t\t) {\n\t\t\t// noop - User is not logged in or does not have access to the repository
|
|
1
|
+
{"version":3,"file":"sentryErrorHandlers.js","sources":["../../../src/lib/sentryErrorHandlers.ts"],"sourcesContent":["import type { ErrorRequestHandler } from \"express\";\nimport * as Sentry from \"@sentry/node\";\n\nimport {\n\tCreateSliceMachineManagerMiddlewareArgs,\n\tUnauthenticatedError,\n\tUnauthorizedError,\n\tInferSliceAbortError,\n} from \"@slicemachine/manager\";\n\nimport { checkIsSentryEnabled } from \"./checkIsSentryEnabled\";\n\nexport const node = (name: string, error: unknown): void => {\n\tif (checkIsSentryEnabled()) {\n\t\tif (\n\t\t\terror instanceof UnauthenticatedError ||\n\t\t\terror instanceof UnauthorizedError ||\n\t\t\terror instanceof InferSliceAbortError\n\t\t) {\n\t\t\t// noop - No need to track this error in Sentry.\n\t\t\t// 1. User is not logged in or does not have access to the repository\n\t\t\t// 2. Infer slice was aborted by the user, not an error\n\t\t} else {\n\t\t\tSentry.withScope(function (scope) {\n\t\t\t\tscope.setTransactionName(name);\n\t\t\t\tSentry.captureException(error, {\n\t\t\t\t\t...(error instanceof Error ? { extra: { cause: error.cause } } : {}),\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n};\n\nexport const server: ErrorRequestHandler = (error, req, _res, next): void => {\n\tnode(req.path, error);\n\tnext();\n};\n\nexport const rpc: CreateSliceMachineManagerMiddlewareArgs[\"onError\"] = (\n\targs,\n) => {\n\tnode(args.procedurePath.join(\".\"), args.error);\n};\n"],"names":["Sentry.withScope","Sentry.captureException"],"mappings":";;AAYO,MAAM,OAAO,CAAC,MAAc,UAAwB;AAC9B;AAC3B,QACC,iBAAiB,wBACjB,iBAAiB,qBACjB,iBAAiB,qBAChB;AAAA,SAIK;AACNA,gBAAiB,SAAU,OAAK;AAC/B,cAAM,mBAAmB,IAAI;AAC7BC,yBAAwB,OAAO;AAAA,UAC9B,GAAI,iBAAiB,QAAQ,EAAE,OAAO,EAAE,OAAO,MAAM,MAAA,MAAY,CAAA;AAAA,QAAA,CACjE;AAAA,MACF,CAAC;AAAA,IACF;AAAA,EACD;AACD;AAEO,MAAM,SAA8B,CAAC,OAAO,KAAK,MAAM,SAAc;AAC3E,OAAK,IAAI,MAAM,KAAK;AACpB,OAAA;AACD;AAEO,MAAM,MAA0D,CACtE,SACG;AACH,OAAK,KAAK,cAAc,KAAK,GAAG,GAAG,KAAK,KAAK;AAC9C;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "start-slicemachine",
|
|
3
|
-
"version": "0.12.68
|
|
3
|
+
"version": "0.12.68",
|
|
4
4
|
"description": "Start Slice Machine from within a project.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@prismicio/mocks": "2.14.0",
|
|
59
59
|
"@prismicio/types-internal": "3.11.2",
|
|
60
|
-
"@slicemachine/manager": "0.26.3
|
|
60
|
+
"@slicemachine/manager": "0.26.3",
|
|
61
61
|
"body-parser": "^1.20.3",
|
|
62
62
|
"chalk": "^4.1.2",
|
|
63
63
|
"cors": "^2.8.5",
|
|
@@ -99,6 +99,5 @@
|
|
|
99
99
|
},
|
|
100
100
|
"engines": {
|
|
101
101
|
"node": ">=20.19.0"
|
|
102
|
-
}
|
|
103
|
-
"stableVersion": "0.12.67"
|
|
102
|
+
}
|
|
104
103
|
}
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
CreateSliceMachineManagerMiddlewareArgs,
|
|
6
6
|
UnauthenticatedError,
|
|
7
7
|
UnauthorizedError,
|
|
8
|
+
InferSliceAbortError,
|
|
8
9
|
} from "@slicemachine/manager";
|
|
9
10
|
|
|
10
11
|
import { checkIsSentryEnabled } from "./checkIsSentryEnabled";
|
|
@@ -13,9 +14,12 @@ export const node = (name: string, error: unknown): void => {
|
|
|
13
14
|
if (checkIsSentryEnabled()) {
|
|
14
15
|
if (
|
|
15
16
|
error instanceof UnauthenticatedError ||
|
|
16
|
-
error instanceof UnauthorizedError
|
|
17
|
+
error instanceof UnauthorizedError ||
|
|
18
|
+
error instanceof InferSliceAbortError
|
|
17
19
|
) {
|
|
18
|
-
// noop -
|
|
20
|
+
// noop - No need to track this error in Sentry.
|
|
21
|
+
// 1. User is not logged in or does not have access to the repository
|
|
22
|
+
// 2. Infer slice was aborted by the user, not an error
|
|
19
23
|
} else {
|
|
20
24
|
Sentry.withScope(function (scope) {
|
|
21
25
|
scope.setTransactionName(name);
|