Error codes are not strings?
I was trying to compare the error code returned from the authClient, but when I print the value of the enum it just prints Proxy so the switch fails. See screenshots


5 Replies
Are you on latest version of Better Auth?
I'm on v1.2.4
Assume that's the latest?

I thought we made error codes work in runtime as well but I just checked the docs and we only mention on how to use them to infer types. For now use how the guide suggests how to handle error code, but we'll fix this soon.
https://www.better-auth.com/docs/concepts/client#error-codes
Client | Better Auth
Better Auth client library for authentication.
Yeah this is what I did for now
