"use strict";
// Code generated by op-codegen - DO NOT EDIT MANUALLY
Object.defineProperty(exports, "__esModule", { value: true });
exports.throwError = exports.RateLimitExceededError = exports.DesktopSessionExpiredError = void 0;
class DesktopSessionExpiredError extends Error {
    constructor(message) {
        super();
        this.message = message;
    }
}
exports.DesktopSessionExpiredError = DesktopSessionExpiredError;
class RateLimitExceededError extends Error {
    constructor(message) {
        super();
        this.message = message;
    }
}
exports.RateLimitExceededError = RateLimitExceededError;
const throwError = (errString) => {
    let err;
    try {
        err = JSON.parse(errString);
    }
    catch (e) {
        throw new Error(errString);
    }
    switch (err.name) {
        case "DesktopSessionExpired":
            throw new DesktopSessionExpiredError(err.message);
        case "RateLimitExceeded":
            throw new RateLimitExceededError(err.message);
        default:
            throw new Error(err.message);
    }
};
exports.throwError = throwError;
