"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NotFoundError = void 0;
const ServiceError_1 = require("./ServiceError");
const SERVICE_NAME = process.env.SERVICE_NAME || 'SERVICE_NAME_NOT_DEFINED';
class NotFoundError extends ServiceError_1.ServiceError {
    static itemNotFoundInDynamoDb(searchParams) {
        const { Key } = searchParams;
        const id = (Key === null || Key === void 0 ? void 0 : Key.id) || Key;
        return new NotFoundError(`Unable to find entity with id ${id}`);
    }
    static itemsNotFoundInDynamoDb(searchParams) {
        const { KeyConditionExpression } = searchParams;
        return new NotFoundError(`Unable to find entities with condition: ${JSON.stringify(KeyConditionExpression)}`);
    }
    constructor(message) {
        super(404, false, message);
    }
    toString() {
        return `NotFoundError in ${SERVICE_NAME}: ${this.message}`;
    }
}
exports.NotFoundError = NotFoundError;
//# sourceMappingURL=NotFoundError.js.map