x25 5.1.2 → 5.1.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/Async/RouteLoading.js +15 -17
- package/Async/SimulatedException.js +6 -5
- package/package.json +1 -1
package/Async/RouteLoading.js
CHANGED
|
@@ -14,29 +14,27 @@ var _SimulatedException = require("./SimulatedException");
|
|
|
14
14
|
|
|
15
15
|
var _SimulatedException2 = _interopRequireDefault(_SimulatedException);
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _Error = require("../messages/Error");
|
|
18
|
+
|
|
19
|
+
var _Error2 = _interopRequireDefault(_Error);
|
|
18
20
|
|
|
19
21
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
22
|
|
|
21
|
-
var
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
var RouteLoading = function RouteLoading(_ref) {
|
|
24
|
+
var error = _ref.error,
|
|
25
|
+
retry = _ref.retry,
|
|
26
|
+
timedOut = _ref.timedOut;
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
};
|
|
28
|
+
if (error) {
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
retry = _ref2.retry,
|
|
32
|
-
timedOut = _ref2.timedOut;
|
|
30
|
+
// eslint-disable-next-line no-console
|
|
31
|
+
console.log("error", error);
|
|
33
32
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
);
|
|
33
|
+
if (error.name === "ChunkLoadError") {
|
|
34
|
+
return _react2.default.createElement(_Error2.default, { message: "Pagina nu a putut fi \xEEnc\u0103rcat\u0103. V\u0103 rug\u0103m s\u0103 face\u021Bi refresh la pagin\u0103" });
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
throw new _SimulatedException2.default(error);
|
|
40
38
|
}
|
|
41
39
|
|
|
42
40
|
if (timedOut) {
|
|
@@ -12,17 +12,18 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
|
12
12
|
|
|
13
13
|
/* eslint-disable max-classes-per-file */
|
|
14
14
|
|
|
15
|
+
// eslint-disable-next-line no-unused-vars
|
|
15
16
|
var CustomError = function (_Error) {
|
|
16
17
|
_inherits(CustomError, _Error);
|
|
17
18
|
|
|
18
|
-
function CustomError(
|
|
19
|
+
function CustomError(error) {
|
|
19
20
|
_classCallCheck(this, CustomError);
|
|
20
21
|
|
|
21
|
-
var _this = _possibleConstructorReturn(this, (CustomError.__proto__ || Object.getPrototypeOf(CustomError)).call(this,
|
|
22
|
+
var _this = _possibleConstructorReturn(this, (CustomError.__proto__ || Object.getPrototypeOf(CustomError)).call(this, error));
|
|
22
23
|
|
|
23
|
-
_this.message = message;
|
|
24
|
-
_this.name =
|
|
25
|
-
_this.stack = stack;
|
|
24
|
+
_this.message = error.message;
|
|
25
|
+
_this.name = error.name;
|
|
26
|
+
_this.stack = error.stack;
|
|
26
27
|
return _this;
|
|
27
28
|
}
|
|
28
29
|
|
package/package.json
CHANGED