/**
 * An edge-case was hit in the client that should never have been reached.
 */
export class UnexpectedClientError extends Error {
    constructor() {
        super('An unexpected error occurred on the client');
        this.name = 'UnexpectedClientError';
    }
}
/**
 * An error occurred during the broadcasting process.
 */
export class BroadcastErrorObject extends Error {
    constructor(message, result) {
        super(message);
        this.name = 'BroadcastError';
        this.result = result;
        this.code = result.code;
        this.codespace = result.codespace;
    }
}
/**
 * User error occurred during a client operation.
 */
export class UserError extends Error {
    constructor(message) {
        super(message);
        this.name = 'UserError';
    }
}
/**
 * @description Base class for custom errors.
 */
export class CustomError extends Error {
    constructor(message) {
        super(message);
        // Set a more specific name. This will show up in e.g. console.log.
        this.name = this.constructor.toString();
    }
}
/**
 * @description Base class for a custom error which wraps another error.
 */
export class WrappedError extends CustomError {
    constructor(message, originalError) {
        super(message);
        this.originalError = originalError;
    }
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXJyb3JzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vc3JjL2NsaWVudHMvbGliL2Vycm9ycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFJQTs7R0FFRztBQUNILE1BQU0sT0FBTyxxQkFBc0IsU0FBUSxLQUFLO0lBQzlDO1FBQ0UsS0FBSyxDQUFDLDRDQUE0QyxDQUFDLENBQUM7UUFDcEQsSUFBSSxDQUFDLElBQUksR0FBRyx1QkFBdUIsQ0FBQztJQUN0QyxDQUFDO0NBQ0Y7QUFFRDs7R0FFRztBQUNILE1BQU0sT0FBTyxvQkFBcUIsU0FBUSxLQUFLO0lBSzdDLFlBQVksT0FBZSxFQUFFLE1BQStCO1FBQzFELEtBQUssQ0FBQyxPQUFPLENBQUMsQ0FBQztRQUNmLElBQUksQ0FBQyxJQUFJLEdBQUcsZ0JBQWdCLENBQUM7UUFDN0IsSUFBSSxDQUFDLE1BQU0sR0FBRyxNQUFNLENBQUM7UUFDckIsS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