congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
RestErrorCallback
Code IndexAdd Tabnine to your IDE (free)

How to use
RestErrorCallback
in
org.jboss.errai.enterprise.client.jaxrs.api

Best Java code snippets using org.jboss.errai.enterprise.client.jaxrs.api.RestErrorCallback (Showing top 3 results out of 315)

origin: errai/errai

@Override
@SuppressWarnings("Duplicates")
public boolean error(final Request message, final Throwable caught) throws MissingPageRoleException {
 return wrapped.error(message, caught) && handler.handleException(caught);
}
origin: org.jboss.errai/errai-security-client

@Override
@SuppressWarnings("Duplicates")
public boolean error(final Request message, final Throwable caught) throws MissingPageRoleException {
 return wrapped.error(message, caught) && handler.handleException(caught);
}
origin: org.jboss.errai/errai-jaxrs-client

protected void handleError(final Throwable throwable, final Request request, final Response response) {
 final ErrorCallback<?> errorCallback = getErrorCallback();
 if (errorCallback != null) {
  if (errorCallback instanceof RestErrorCallback) {
   ((RestErrorCallback) errorCallback).error(request, throwable);
  }
  else {
   /*
    * Because of type erasure, there's no way to know if an ErrorCallback that doesn't implement RestErrorCallback takes
    * a request as an argument. But in some cases we want to wrap callbacks (such as in Caller<T>) to further control when
    * they are executed, and this is done in code upstream of RestErrorCallback.
    *
    * Thus, here we simply try to invoke with a request, and fallback to passing null if we get a casting exception.
    */
   try {
    ((ErrorCallback<? super Request>) errorCallback).error(request, throwable);
   }
   catch (final ClassCastException e) {
    logger.debug("Class cast exception when invoking error callback with request object: {}", request);
    logger.debug("Invoking error callback again with null.");
    errorCallback.error(null, throwable);
   }
  }
 }
 else {
  GWT.log(throwable.getMessage(), throwable);
 }
}
org.jboss.errai.enterprise.client.jaxrs.apiRestErrorCallback

Javadoc

A callback that is invoked when a request to a REST endpoint fails.

Most used methods

  • error

Popular in Java

  • Reactive rest calls using spring rest template
  • setRequestProperty (URLConnection)
  • onRequestPermissionsResult (Fragment)
  • putExtra (Intent)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • IsNull (org.hamcrest.core)
    Is the value null?
  • 21 Best Atom Packages for 2021
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now