Instead of throwing an IOException with String message, use the new
HttpException. The exception handling code can then use the status
code to be more specific how to handle the exception.
Also: use try-with-resources for the okhttp response where possible
All the HTTP clients now check, if loading the cookies was sufficient
to restore the HTTP session. If yes, we assume that we are logged in.
If not, the normal login procedure is done.
This dialog is shown, if the normal login didn't work. For example,
if you log in several times in a short amount of time, they respond
with "Please confirm that you are not a robot" and you have to log
in with a captcha