@shuvi/error-overlay 1.0.21 → 1.0.23
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/client.js +4 -1
- package/lib/iframe-bundle.js +7 -0
- package/package.json +3 -3
- package/umd/index.js +12 -2
package/lib/client.js
CHANGED
|
@@ -148,6 +148,7 @@ function update() {
|
|
|
148
148
|
const appDocument = window.document;
|
|
149
149
|
appDocument.body.appendChild(loadingIframe);
|
|
150
150
|
}
|
|
151
|
+
let prevRendered = false;
|
|
151
152
|
function updateIframeContent() {
|
|
152
153
|
if (!iframe) {
|
|
153
154
|
throw new Error('Iframe has not been created yet.');
|
|
@@ -160,11 +161,13 @@ function updateIframeContent() {
|
|
|
160
161
|
});
|
|
161
162
|
//After the errors have been added to the queue of the error handler, we must clear the errorTypeList
|
|
162
163
|
errorTypeList = [];
|
|
163
|
-
|
|
164
|
+
// Continuous errors and no errors will not operate dom
|
|
165
|
+
if (prevRendered && !isRendered) {
|
|
164
166
|
window.document.body.removeChild(iframe);
|
|
165
167
|
iframe = null;
|
|
166
168
|
isIframeReady = false;
|
|
167
169
|
}
|
|
170
|
+
prevRendered = isRendered;
|
|
168
171
|
}
|
|
169
172
|
window.__SHUVI_ERROR_OVERLAY_GLOBAL_HOOK__ =
|
|
170
173
|
window.__SHUVI_ERROR_OVERLAY_GLOBAL_HOOK__ || {};
|
package/lib/iframe-bundle.js
CHANGED
|
@@ -2761,6 +2761,13 @@
|
|
|
2761
2761
|
code: 500,
|
|
2762
2762
|
message: 'Internal Application Error.'
|
|
2763
2763
|
},
|
|
2764
|
+
SERVER_ERROR: {
|
|
2765
|
+
code: 500,
|
|
2766
|
+
message: 'Internal Server Error.'
|
|
2767
|
+
},
|
|
2768
|
+
CLIENT_ERROR: {
|
|
2769
|
+
message: 'Internal Application Error'
|
|
2770
|
+
},
|
|
2764
2771
|
PAGE_NOT_FOUND: {
|
|
2765
2772
|
code: 404,
|
|
2766
2773
|
message: 'This page could not be found.'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shuvi/error-overlay",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.23",
|
|
4
4
|
"main": "umd/index.js",
|
|
5
5
|
"types": "lib/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@babel/code-frame": "7.14.5",
|
|
26
|
-
"@shuvi/shared": "1.0.
|
|
27
|
-
"@shuvi/toolpack": "1.0.
|
|
26
|
+
"@shuvi/shared": "1.0.23",
|
|
27
|
+
"@shuvi/toolpack": "1.0.23",
|
|
28
28
|
"anser": "1.4.9",
|
|
29
29
|
"data-uri-to-buffer": "3.0.1",
|
|
30
30
|
"html-entities": "2.3.2",
|