Trouble Handling Authorization Error in TypeScript Code

im struggling to throw an error, for some reason this ends up as a 500 and i just not sure why

const response = yield* authFns
      .handleAuthorize({ query, path })
      .pipe(
        Effect.catchTag('FetchError', () =>
         HttpError.unauthorizedError('Unauthorized')
        ),
      );


Ive tried like a thousand ways and im sure its something super dumb.
Was this page helpful?