"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.EntityMetadataNotFoundError = void 0;
const EntitySchema_1 = require("../entity-schema/EntitySchema");
const TypeORMError_1 = require("./TypeORMError");
class EntityMetadataNotFoundError extends TypeORMError_1.TypeORMError {
    constructor(target) {
        super();
        this.message = `No metadata for "${this.stringifyTarget(target)}" was found.`;
    }
    stringifyTarget(target) {
        if (target instanceof EntitySchema_1.EntitySchema) {
            return target.options.name;
        }
        else if (typeof target === "function") {
            return target.name;
        }
        else if (typeof target === "object" && "name" in target) {
            return target.name;
        }
        else {
            return target;
        }
    }
}
exports.EntityMetadataNotFoundError = EntityMetadataNotFoundError;

//# sourceMappingURL=EntityMetadataNotFoundError.js.map
