@next-core/brick-kit 2.185.1 → 2.185.3

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/index.esm.js CHANGED
@@ -4238,44 +4238,52 @@ function LoginTimeoutMessage() {
4238
4238
  }
4239
4239
  function getConfOfHttpStatus(error) {
4240
4240
  var _error$response;
4241
- switch ((_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.status) {
4242
- case 403:
4243
- return {
4244
- showBackLink: true,
4245
- title: i18next.t("".concat(NS_BRICK_KIT, ":").concat(K.NO_PERMISSION)),
4246
- illustration: {
4247
- name: "no-permission",
4248
- category: "easyops2"
4249
- }
4250
- };
4251
- default:
4252
- return null;
4241
+ if (error instanceof HttpResponseError && ((_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.status) === 403) {
4242
+ return {
4243
+ showBackLink: true,
4244
+ title: i18next.t("".concat(NS_BRICK_KIT, ":").concat(K.NO_PERMISSION)),
4245
+ illustration: {
4246
+ name: "no-permission",
4247
+ category: "easyops2"
4248
+ }
4249
+ };
4253
4250
  }
4251
+ return null;
4254
4252
  }
4255
4253
  function getConfOfHttpCode(error) {
4256
4254
  var _error$responseJson;
4257
- switch ((_error$responseJson = error.responseJson) === null || _error$responseJson === void 0 ? void 0 : _error$responseJson.code) {
4258
- case "200000":
4259
- return {
4260
- title: i18next.t("".concat(NS_BRICK_KIT, ":").concat(K.LICENSE_EXPIRED)),
4261
- illustration: {
4262
- name: "license-expired",
4263
- category: "easyops2"
4264
- }
4265
- };
4266
- default:
4267
- return {
4268
- showBackLink: true,
4269
- title: i18next.t("".concat(NS_BRICK_KIT, ":").concat(K.OTHER_ERROR)),
4270
- illustration: {
4271
- name: "unknown-error",
4272
- category: "easyops2"
4273
- }
4274
- };
4255
+ if (error instanceof HttpResponseError && ((_error$responseJson = error.responseJson) === null || _error$responseJson === void 0 ? void 0 : _error$responseJson.code) === "200000") {
4256
+ return {
4257
+ title: i18next.t("".concat(NS_BRICK_KIT, ":").concat(K.LICENSE_EXPIRED)),
4258
+ illustration: {
4259
+ name: "license-expired",
4260
+ category: "easyops2"
4261
+ }
4262
+ };
4263
+ }
4264
+ return {
4265
+ showBackLink: true,
4266
+ title: i18next.t("".concat(NS_BRICK_KIT, ":").concat(K.OTHER_ERROR)),
4267
+ illustration: {
4268
+ name: "unknown-error",
4269
+ category: "easyops2"
4270
+ }
4271
+ };
4272
+ }
4273
+ function getConfOfSpecialError(error) {
4274
+ if (error instanceof Error && error.name === "ChunkLoadError") {
4275
+ return {
4276
+ title: i18next.t("".concat(NS_BRICK_KIT, ":").concat(K.NETWORK_ERROR)),
4277
+ illustration: {
4278
+ name: "internet-disconnected",
4279
+ category: "easyops2"
4280
+ }
4281
+ };
4275
4282
  }
4283
+ return null;
4276
4284
  }
4277
4285
  function getRefinedErrorConf(error) {
4278
- return [getConfOfHttpStatus, getConfOfHttpCode].reduce((result, method) => result ? result : method(error), null);
4286
+ return [getConfOfSpecialError, getConfOfHttpStatus, getConfOfHttpCode].reduce((result, method) => result ? result : method(error), null);
4279
4287
  }
4280
4288
 
4281
4289
  class WebsocketMessageRequest {
@@ -12133,7 +12141,9 @@ class Router {
12133
12141
  // we say *page found*, otherwise, *page not found*.
12134
12142
  if (route && route.type !== "routes" || failed) {
12135
12143
  var _this3$kernel$bootstr3, _this3$kernel$bootstr4, _getAuth$license;
12136
- yield pendingTask;
12144
+ if (!failed) {
12145
+ yield pendingTask;
12146
+ }
12137
12147
  window.DISABLE_REACT_FLUSH_SYNC = false;
12138
12148
  setUIVersion(currentApp === null || currentApp === void 0 ? void 0 : currentApp.uiVersion);
12139
12149
  main.length > 0 && mountTree(main, mountPoints.main);