export class ServerError extends Error {
    code;
    static from({ code, message }) {
        return new ServerError(code, message);
    }
    constructor(code, message, options) {
        super(message, options);
        this.code = code;
        this.name = this.constructor.name;
        // `Error.captureStackTrace` is not available in all browsers
        if ("captureStackTrace" in Error) {
            Error.captureStackTrace(this, this.constructor);
        }
    }
}
//# sourceMappingURL=error.js.map