supabase / supabase-swift

A Swift client for Supabase
https://supabase.com/docs/reference/swift
MIT License
713 stars 108 forks source link

feat(auth): add support for error codes and refactor `AuthError` #518

Closed grdsdev closed 2 months ago

grdsdev commented 2 months ago

What kind of change does this PR introduce?

This PR includes some changes on Auth error system, I tried my best to keep it compatible and without breaking changes.

If you see anything that could be a breaking change, please let me know.

What is the new behavior?

Error codes

Introduce ErrorCode type as a raw representable string, added static properties for each of the known error codes. Since error codes are raw representable strings, if an unknown error code is returned, decoding is going to work fine.

Deprecated errors

Added errors