Handling Defects with Sentry in @effect/platform's HttpApiBuilder

Hello! I'm using @effect/platform with the HttpApiBuilder.toWebHandler(). I was wondering if there was a way to catch defects so I can report them via Sentry.

const paginate = Effect.fn("VendorsRepository.paginate")(function* (
  paginationInput: typeof PaginationInput.Type
) {
  const pagination = getPagination(paginationInput);

  const [data, total] = yield* Effect.all([
    db
      .select()
      .from(vendors)
      .offset(pagination.offset)
      .limit(pagination.limit),
    db.select({ count: count() }).from(vendors),
  ]).pipe(Effect.catchAll((e) => Effect.die(e)));

  return getPaginationOutput({ data, total }, pagination);
});


Let's say that I encounter an SqlError. How should I handle this so it gets to Sentry?
Was this page helpful?