@trackunit/react-core-contexts 1.0.14 → 1.0.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/index.cjs.js +6 -4
- package/index.esm.js +6 -4
- package/package.json +3 -3
package/index.cjs.js
CHANGED
|
@@ -73,19 +73,17 @@ const createApolloClient = ({ graphqlManagerUrl, graphqlPublicUrl, graphqlIntern
|
|
|
73
73
|
};
|
|
74
74
|
});
|
|
75
75
|
const errorLink = error.onError((errorResponse) => {
|
|
76
|
-
var _a, _b;
|
|
77
76
|
const traceIds = []; // Used to hold id's for use in Sentry
|
|
78
77
|
if (errorResponse.graphQLErrors) {
|
|
79
|
-
const code =
|
|
78
|
+
const code = errorResponse.graphQLErrors[0]?.extensions?.code;
|
|
80
79
|
if (code === "FORCE_RELOAD_BROWSER") {
|
|
81
80
|
window.location.reload();
|
|
82
81
|
}
|
|
83
82
|
// eslint-disable-next-line no-console
|
|
84
83
|
console.error(`Error calling: '${errorResponse.operation.getContext().clientAwareness.name}' fetching Data for: ${errorResponse.operation.operationName}`, errorResponse.graphQLErrors);
|
|
85
84
|
errorResponse.graphQLErrors.forEach(error => {
|
|
86
|
-
var _a, _b;
|
|
87
85
|
if ("extensions" in error) {
|
|
88
|
-
error.extensions.traceId =
|
|
86
|
+
error.extensions.traceId = errorResponse.response?.extensions?.traceId;
|
|
89
87
|
// eslint-disable-next-line local-rules/no-typescript-assertion
|
|
90
88
|
const traceId = error.extensions.traceId;
|
|
91
89
|
traceIds.push(traceId);
|
|
@@ -130,6 +128,10 @@ const createApolloClient = ({ graphqlManagerUrl, graphqlPublicUrl, graphqlIntern
|
|
|
130
128
|
}
|
|
131
129
|
}
|
|
132
130
|
if (errorResponse.networkError) {
|
|
131
|
+
// We skip the error logging if the error is an AbortError
|
|
132
|
+
if (errorResponse.networkError.name === "AbortError") {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
133
135
|
// eslint-disable-next-line no-console
|
|
134
136
|
console.error(errorResponse.networkError);
|
|
135
137
|
}
|
package/index.esm.js
CHANGED
|
@@ -53,19 +53,17 @@ const createApolloClient = ({ graphqlManagerUrl, graphqlPublicUrl, graphqlIntern
|
|
|
53
53
|
};
|
|
54
54
|
});
|
|
55
55
|
const errorLink = onError((errorResponse) => {
|
|
56
|
-
var _a, _b;
|
|
57
56
|
const traceIds = []; // Used to hold id's for use in Sentry
|
|
58
57
|
if (errorResponse.graphQLErrors) {
|
|
59
|
-
const code =
|
|
58
|
+
const code = errorResponse.graphQLErrors[0]?.extensions?.code;
|
|
60
59
|
if (code === "FORCE_RELOAD_BROWSER") {
|
|
61
60
|
window.location.reload();
|
|
62
61
|
}
|
|
63
62
|
// eslint-disable-next-line no-console
|
|
64
63
|
console.error(`Error calling: '${errorResponse.operation.getContext().clientAwareness.name}' fetching Data for: ${errorResponse.operation.operationName}`, errorResponse.graphQLErrors);
|
|
65
64
|
errorResponse.graphQLErrors.forEach(error => {
|
|
66
|
-
var _a, _b;
|
|
67
65
|
if ("extensions" in error) {
|
|
68
|
-
error.extensions.traceId =
|
|
66
|
+
error.extensions.traceId = errorResponse.response?.extensions?.traceId;
|
|
69
67
|
// eslint-disable-next-line local-rules/no-typescript-assertion
|
|
70
68
|
const traceId = error.extensions.traceId;
|
|
71
69
|
traceIds.push(traceId);
|
|
@@ -110,6 +108,10 @@ const createApolloClient = ({ graphqlManagerUrl, graphqlPublicUrl, graphqlIntern
|
|
|
110
108
|
}
|
|
111
109
|
}
|
|
112
110
|
if (errorResponse.networkError) {
|
|
111
|
+
// We skip the error logging if the error is an AbortError
|
|
112
|
+
if (errorResponse.networkError.name === "AbortError") {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
113
115
|
// eslint-disable-next-line no-console
|
|
114
116
|
console.error(errorResponse.networkError);
|
|
115
117
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-core-contexts",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.16",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
"react": "18.3.1",
|
|
12
12
|
"@js-temporal/polyfill": "^0.4.4",
|
|
13
13
|
"jest-fetch-mock": "^3.0.3",
|
|
14
|
-
"@trackunit/iris-app-api": "^1.0.
|
|
14
|
+
"@trackunit/iris-app-api": "^1.0.4",
|
|
15
15
|
"@trackunit/react-core-contexts-api": "^1.0.5",
|
|
16
16
|
"@trackunit/react-core-hooks": "^1.0.5",
|
|
17
|
-
"@trackunit/i18n-library-translation": "^1.0.
|
|
17
|
+
"@trackunit/i18n-library-translation": "^1.0.7",
|
|
18
18
|
"@trackunit/react-components": "^1.0.13",
|
|
19
19
|
"@trackunit/iris-app-runtime-core": "^1.0.5"
|
|
20
20
|
},
|