Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void checkForHTTPException(Throwable throwable) {
- String msg = throwable.getMessage();
- boolean result = msg.contains(ERROR_HTTP_RESPONSE_401_UNAUTHORIZED_WHEN_COMMUNICATING);
- if (result) {
- throw new VaadinUIException(throwable.getMessage());
- } else {
- Throwable level1 = throwable.getCause();
- msg = level1.getMessage();
- result = msg.contains(ERROR_HTTP_RESPONSE_401_UNAUTHORIZED_WHEN_COMMUNICATING);
- if (result) {
- throw new VaadinUIException(level1.getMessage());
- } else {
- Throwable level2 = throwable.getCause();
- msg = level2.getMessage();
- result = msg.contains(ERROR_HTTP_RESPONSE_401_UNAUTHORIZED_WHEN_COMMUNICATING);
- if (result) {
- throw new VaadinUIException(level2.getMessage());
- } else {
- System.out.println("doh");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement