1 |
|
2 |
|
3 | export function InvalidStoreError(reason, value) {
|
4 | const message = `Store is invalid because ${reason}, ` +
|
5 | `please stop the client, delete all data and start the client again`;
|
6 | const instance = Reflect.construct(Error, [message]);
|
7 | Reflect.setPrototypeOf(instance, Reflect.getPrototypeOf(this));
|
8 | instance.reason = reason;
|
9 | instance.value = value;
|
10 | return instance;
|
11 | }
|
12 |
|
13 | InvalidStoreError.TOGGLED_LAZY_LOADING = "TOGGLED_LAZY_LOADING";
|
14 |
|
15 | InvalidStoreError.prototype = Object.create(Error.prototype, {
|
16 | constructor: {
|
17 | value: Error,
|
18 | enumerable: false,
|
19 | writable: true,
|
20 | configurable: true,
|
21 | },
|
22 | });
|
23 | Reflect.setPrototypeOf(InvalidStoreError, Error);
|
24 |
|
25 |
|
26 | export function InvalidCryptoStoreError(reason) {
|
27 | const message = `Crypto store is invalid because ${reason}, ` +
|
28 | `please stop the client, delete all data and start the client again`;
|
29 | const instance = Reflect.construct(Error, [message]);
|
30 | Reflect.setPrototypeOf(instance, Reflect.getPrototypeOf(this));
|
31 | instance.reason = reason;
|
32 | instance.name = 'InvalidCryptoStoreError';
|
33 | return instance;
|
34 | }
|
35 |
|
36 | InvalidCryptoStoreError.TOO_NEW = "TOO_NEW";
|
37 |
|
38 | InvalidCryptoStoreError.prototype = Object.create(Error.prototype, {
|
39 | constructor: {
|
40 | value: Error,
|
41 | enumerable: false,
|
42 | writable: true,
|
43 | configurable: true,
|
44 | },
|
45 | });
|
46 | Reflect.setPrototypeOf(InvalidCryptoStoreError, Error);
|
47 |
|
48 | export class KeySignatureUploadError extends Error {
|
49 | constructor(message, value) {
|
50 | super(message);
|
51 | this.value = value;
|
52 | }
|
53 | }
|