UNPKG

2.37 kBJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6
7var _create = require("babel-runtime/core-js/object/create");
8
9var _create2 = _interopRequireDefault(_create);
10
11var _getPrototypeOf = require("babel-runtime/core-js/reflect/get-prototype-of");
12
13var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
14
15var _setPrototypeOf = require("babel-runtime/core-js/reflect/set-prototype-of");
16
17var _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf);
18
19var _construct = require("babel-runtime/core-js/reflect/construct");
20
21var _construct2 = _interopRequireDefault(_construct);
22
23exports.InvalidStoreError = InvalidStoreError;
24exports.InvalidCryptoStoreError = InvalidCryptoStoreError;
25
26function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
28// can't just do InvalidStoreError extends Error
29// because of http://babeljs.io/docs/usage/caveats/#classes
30function InvalidStoreError(reason, value) {
31 var message = "Store is invalid because " + reason + ", " + "please stop the client, delete all data and start the client again";
32 var instance = (0, _construct2.default)(Error, [message]);
33 (0, _setPrototypeOf2.default)(instance, (0, _getPrototypeOf2.default)(this));
34 instance.reason = reason;
35 instance.value = value;
36 return instance;
37}
38
39InvalidStoreError.TOGGLED_LAZY_LOADING = "TOGGLED_LAZY_LOADING";
40
41InvalidStoreError.prototype = (0, _create2.default)(Error.prototype, {
42 constructor: {
43 value: Error,
44 enumerable: false,
45 writable: true,
46 configurable: true
47 }
48});
49(0, _setPrototypeOf2.default)(InvalidStoreError, Error);
50
51function InvalidCryptoStoreError(reason) {
52 var message = "Crypto store is invalid because " + reason + ", " + "please stop the client, delete all data and start the client again";
53 var instance = (0, _construct2.default)(Error, [message]);
54 (0, _setPrototypeOf2.default)(instance, (0, _getPrototypeOf2.default)(this));
55 instance.reason = reason;
56 instance.name = 'InvalidCryptoStoreError';
57 return instance;
58}
59
60InvalidCryptoStoreError.TOO_NEW = "TOO_NEW";
61
62InvalidCryptoStoreError.prototype = (0, _create2.default)(Error.prototype, {
63 constructor: {
64 value: Error,
65 enumerable: false,
66 writable: true,
67 configurable: true
68 }
69});
70(0, _setPrototypeOf2.default)(InvalidCryptoStoreError, Error);
71//# sourceMappingURL=errors.js.map
\No newline at end of file