Custom error transformation per flow
Reshape errors per auth flow with `errorHandler(error, context)`.
Sometimes you want different error envelopes for different auth flows — maybe login errors include a hint, signup errors include a list of validation issues, etc.
Returning a non-null object replaces the error response. Returning null (or undefined) keeps the library's default.
Don't accidentally hide bugs
The temptation is to wrap every error in a generic "Something went wrong." Don't. The default error codes are precise; your frontend depends on them. Override only where you have a deliberate reason.