How can I catch ConnectException
to inform the user, if the server is down (not available).
I build a login with this code:
Form form = new Form()
.param("username", userName)
.param("password", password);
try {
return ClientBuilder
.newClient()
.target(LOGIN_URL)
.request()
.post(Entity.form(form), User.class);
} catch (NotAuthorizedException e) {
logger.error(e.getMessage(), e);
}
return null;
How can I know, when the backend is down?