return repo.findOne({ id }).pipe(
Effect.catchTag("DatabaseError", (err) =>
pipe(Effect.log(err), Effect.flatMap(() => new InternalServerError()))
),
Effect.catchTag("InvalidPrimaryKeyError", () => new BadRequest()),
Effect.catchTag("EntityNotFoundError", () => new NotFound()),
);
return repo.findOne({ id }).pipe(
Effect.catchTag("DatabaseError", (err) =>
pipe(Effect.log(err), Effect.flatMap(() => new InternalServerError()))
),
Effect.catchTag("InvalidPrimaryKeyError", () => new BadRequest()),
Effect.catchTag("EntityNotFoundError", () => new NotFound()),
);