"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GetImageUseCase = void 0;
const not_found_error_1 = require("../../../domain/errors/not-found-error");
class GetImageUseCase {
    imageStorage;
    constructor(imageStorage) {
        this.imageStorage = imageStorage;
    }
    async execute(type, id) {
        const image = await this.imageStorage.readImage(type, id);
        if (!image) {
            throw new not_found_error_1.NotFoundError('Image', `${type}/${id}`);
        }
        return image;
    }
}
exports.GetImageUseCase = GetImageUseCase;
//# sourceMappingURL=get-image.use-case.js.map