Closed chanseokoh closed 7 years ago
What if instead of returning null on a failed login we threw an exception? Does that make sense? I.e. is a failed login an exceptional condition a client should check for? If we don't do that, they may get an unhandled NullPointerException instead.
It's not always an exceptional case. For example, we allow users to simply log in with the G icon, not doing anything with after login. So I think returning an exception is an overkill.
Forgot to say that users can cancel login in that case.
LGTM assuming tests pass
I realized that
logIn()
should returnAccount
instead ofboolean
so that a caller knows whichAccount
a user signed in with.