@Override
 public void onError(AsyncEvent event) {
   handleError(event.getThrowable());
 }
 @Override
 public void onTimeout(AsyncEvent event) {
   Throwable ex = event.getThrowable();
   ex = (ex != null ? ex : new IllegalStateException("Async operation timeout."));
   handleError(ex);
 }