Issue with Sentry Logging in MySQLServiceLive Layer

I have a very strange issue which I am unsure how to debug further. I have an ErrorTrackerService which in production logs to Sentry.

In my MySQLServiceLive layer I do the following:
    yield* ErrorTrackerService.captureException(
      new DoesGetLoggedError({
        message: "Some David Test 101010",
      }),
    )

    yield* Effect.tryPromise(() => mysql.$connect()).pipe(
      Effect.tapErrorCause((e) =>
        ErrorTrackerService.captureException(
          new DoesNOTGetLoggedError({ message: "Some David Test DOES NOT WORK 1" }),
        ),
      ),
      Effect.orDie,
      Effect.tap(() => Effect.logInfo("MySQL connected")),
    )

But, even though the connection to the database fails (On purpose right now). Only DoesGetLoggedError gets logged to Sentry.

I checked the Sentry debug logger, and it says it does capture the DoesNOTGetLoggedError exception, yet it never shows up in the dashboard.

I tried to swap them, change names, etc, to see if its maybe Sentry filtering it out for some reason. But I also have evrything disabled and the sampleRate set to 1.
Was this page helpful?