Auth helpers: Error data vs. thrown errors?

When using the @supabase/auth-helpers-nextjs library, why does auth.exchangeCodeForSession throw some errors in some cases, even though it should resolve with an AuthTokenResponse that has an error property? I guess I'm overall having hard time understanding when and why an auth helper method should throw and when resolve with the error data.
Was this page helpful?