"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.UnconventionalError = void 0;
const utils_js_1 = require("./utils.cjs");
/**
 * A wrapper error type that represents a non-standard error thrown from a
 * response, such as a symbol or plain object. Read the `cause` property to
 * determine the source of the error.
 */
class UnconventionalError extends Error {
    /** Determine if an error is an `UnconventionalError` instance */
    static is(error) {
        return (0, utils_js_1.isBranded)(error, "UnconventionalError");
    }
    constructor(errorType) {
        super("An error of unexpected shape occurred.", { cause: errorType });
        this.name = "UnconventionalError";
        (0, utils_js_1.brand)(this);
        Object.setPrototypeOf(this, UnconventionalError.prototype);
    }
}
exports.UnconventionalError = UnconventionalError;
//# sourceMappingURL=UnconventionalError.cjs.map
