You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example 'decodeJWTPayload" can throw an error JWT is not valid: not a JWT structure that will then be throw by setSession.
setSession is define to return an error.
setSession (and other function) should make a choice between throw error or return but not both => it’s not a good practice for a function to sometimes throw an error and at other times return a value indicating an error. This can lead to confusion, inconsistency, and difficulty in understanding how the function behaves for users/developpers and maintenance.
The text was updated successfully, but these errors were encountered:
Some function can throw or return error.
For example 'decodeJWTPayload" can throw an error JWT is not valid: not a JWT structure that will then be throw by setSession.
setSession is define to return an error.
auth-js/src/GoTrueClient.ts
Line 1289 in 8222ee1
setSession (and other function) should make a choice between throw error or return but not both => it’s not a good practice for a function to sometimes throw an error and at other times return a value indicating an error. This can lead to confusion, inconsistency, and difficulty in understanding how the function behaves for users/developpers and maintenance.
The text was updated successfully, but these errors were encountered: