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