You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-12-13 07:42:14 +03:00
@@ -1,6 +1,6 @@
|
|||||||
// can't just do InvalidStoreError extends Error
|
// can't just do InvalidStoreError extends Error
|
||||||
// because of http://babeljs.io/docs/usage/caveats/#classes
|
// because of http://babeljs.io/docs/usage/caveats/#classes
|
||||||
export function InvalidStoreError(reason: string, value: boolean): void {
|
export function InvalidStoreError(reason, value) {
|
||||||
const message = `Store is invalid because ${reason}, ` +
|
const message = `Store is invalid because ${reason}, ` +
|
||||||
`please stop the client, delete all data and start the client again`;
|
`please stop the client, delete all data and start the client again`;
|
||||||
const instance = Reflect.construct(Error, [message]);
|
const instance = Reflect.construct(Error, [message]);
|
||||||
@@ -13,16 +13,16 @@ export function InvalidStoreError(reason: string, value: boolean): void {
|
|||||||
InvalidStoreError.TOGGLED_LAZY_LOADING = "TOGGLED_LAZY_LOADING";
|
InvalidStoreError.TOGGLED_LAZY_LOADING = "TOGGLED_LAZY_LOADING";
|
||||||
|
|
||||||
InvalidStoreError.prototype = Object.create(Error.prototype, {
|
InvalidStoreError.prototype = Object.create(Error.prototype, {
|
||||||
constructor: {
|
constructor: {
|
||||||
value: Error,
|
value: Error,
|
||||||
enumerable: false,
|
enumerable: false,
|
||||||
writable: true,
|
writable: true,
|
||||||
configurable: true,
|
configurable: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
Reflect.setPrototypeOf(InvalidStoreError, Error);
|
Reflect.setPrototypeOf(InvalidStoreError, Error);
|
||||||
|
|
||||||
export function InvalidCryptoStoreError(reason: string): void {
|
export function InvalidCryptoStoreError(reason) {
|
||||||
const message = `Crypto store is invalid because ${reason}, ` +
|
const message = `Crypto store is invalid because ${reason}, ` +
|
||||||
`please stop the client, delete all data and start the client again`;
|
`please stop the client, delete all data and start the client again`;
|
||||||
const instance = Reflect.construct(Error, [message]);
|
const instance = Reflect.construct(Error, [message]);
|
||||||
@@ -35,17 +35,18 @@ export function InvalidCryptoStoreError(reason: string): void {
|
|||||||
InvalidCryptoStoreError.TOO_NEW = "TOO_NEW";
|
InvalidCryptoStoreError.TOO_NEW = "TOO_NEW";
|
||||||
|
|
||||||
InvalidCryptoStoreError.prototype = Object.create(Error.prototype, {
|
InvalidCryptoStoreError.prototype = Object.create(Error.prototype, {
|
||||||
constructor: {
|
constructor: {
|
||||||
value: Error,
|
value: Error,
|
||||||
enumerable: false,
|
enumerable: false,
|
||||||
writable: true,
|
writable: true,
|
||||||
configurable: true,
|
configurable: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
Reflect.setPrototypeOf(InvalidCryptoStoreError, Error);
|
Reflect.setPrototypeOf(InvalidCryptoStoreError, Error);
|
||||||
|
|
||||||
export class KeySignatureUploadError extends Error {
|
export class KeySignatureUploadError extends Error {
|
||||||
constructor(message: string, public value: { failures: any }) { // TODO: types
|
constructor(message, value) {
|
||||||
super(message);
|
super(message);
|
||||||
}
|
this.value = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user