"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ErrorResource = void 0;
const Resource_ts_1 = require("./Resource.js");
/**
 * ErrorResource is a Resource that throws an error on any request, communicating to the client when attempts are made
 * to access endpoints/resources that had an internal error in their configuration or setup. This helps ensure that
 * if there is a problem with a resource, it is immediately apparent and can be fixed.
 */
class ErrorResource extends Resource_ts_1.Resource {
    error;
    constructor(error) {
        super(null, null);
        this.error = error;
    }
    isError = true;
    allowRead() {
        throw this.error;
    }
    allowUpdate() {
        throw this.error;
    }
    allowCreate() {
        throw this.error;
    }
    allowDelete() {
        throw this.error;
    }
    getId() {
        throw this.error;
    }
    getContext() {
        throw this.error;
    }
    get() {
        throw this.error;
    }
    post() {
        throw this.error;
    }
    put() {
        throw this.error;
    }
    delete() {
        throw this.error;
    }
    connect() {
        throw this.error;
    }
    getResource() {
        // all child paths resolve back to reporting this error
        return this;
    }
    publish() {
        throw this.error;
    }
    subscribe() {
        throw this.error;
    }
}
exports.ErrorResource = ErrorResource;
//# sourceMappingURL=ErrorResource.js.map