Delivers {@code error} to {@code callback} on the next game tick (on the PlayN thread).
10780
public void notifyFailure(final Callback<?> callback, final Throwable error) {
    invokeLater(new Runnable() {
      public void run() {
        callback.onFailure(error);
      }
    });
  }
1977
public static <A> FutureCallback<A> futureCallback(final Action<A> success, final Action<Throwable> failure) {
        return new FutureCallback<A>() {
            @Override public void onSuccess(A result) {
                checkNotNull(success).apply(result);
            }

            @Override public void onFailure(Throwable t) {
                checkNotNull(failure).apply(t);
            }
        };
    }
1320572
function done() {
        var arg = errors.length ? errors : null
        --pending || process.nextTick(callback, arg)
    }
1066611
function AbstractCliError(message, statusCode) {
	Error.call(this, message, statusCode);
	Error.captureStackTrace(this, AbstractCliError);

	this.message = message || this.message
}
1123533
public void onFailure(Throwable t)
    {
        MessagingService.instance().sendOneWay(new SyncComplete(desc, request.src, request.dst, false).createMessage(), request.initiator);
    }
1320805
function chainAndErrorCallback(cb, next) {
    var browser = this;

    return function wrapDefault() {
        if (cb) {
            try {
                cb = errorToExceptionCallback.call(browser, cb);
                cb.apply(browser, _.toArray(arguments).concat([next]));
            } catch (e) {
                next(e);
            }
        } else if (next) {
            next.apply(this, arguments);
        }
    };
}
1201888
def _wrap_callback_errors(callback, message):
    
    try:
        callback(message)
    except Exception:
        # Note: the likelihood of this failing is extremely low. This just adds
        # a message to a queue, so if this doesn't work the world is in an
        # unrecoverable state and this thread should just bail.
        _LOGGER.exception(
            "Top-level exception occurred in callback while processing a " "message"
        )
        message.nack()
862455
private void postConnectError(final ConnectCompletionListener completionListener, final String errorMessage) {
        new Handler(Looper.getMainLooper()).post(new Runnable() {
            @Override
            public void run() {
                if (null != completionListener) {
                    completionListener.onError(errorMessage);
                }
            }
        });
    }
21159
@Override
    public void error(VirtualConnection vc, Throwable t) { 
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Calling user's ReadListener onError : " + this.in.getReadListener());
        }
        Exception e = null;
        
        SRTServletRequestThreadData.getInstance().init(_requestDataAsyncReadCallbackThread);
        
        //Push the original thread's context onto the current thread, also save off the current thread's context
        this.threadContextManager.pushContextData();
        
        if(this.in.getReadListener() != null){
            synchronized( this.in.getCompleteLockObj()){
                try {
                    //An error occurred. Issue the onError call on the user's ReadListener
                    this.in.getReadListener().onError(t);
                } catch (Exception onErrorException) {
                    e = onErrorException;
                }
            }

            if (e != null && TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Exception occurred during ReadListener.onError : " + e + ", " + this.in.getReadListener());
            }
            else{
                if (t != null && TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "Exception occurred during ReadListener and error cannot handle : " + t.getMessage() + ", " + this.in.getReadListener());
                }
            }
        }
        
        //Revert back to the thread's current context
        this.threadContextManager.popContextData();

    }
403637
function callback(err, response, body)
    {
      if (err)
      {
        // if we haven't exceeded the maximum number of retries yet and the
        // server came back with a retryable error code.
        if (numRetries < maxNumRetries && isRetryableError(response, err))
        {
          // increment the number of retries
          numRetries++;

          // use exponential backoff with decorrelated jitter to compute the
          // next sleep time:
          var cap = connectionConfig.getRetryLargeResultSetMaxSleepTime();
          sleep = Util.nextSleepTime(1, cap, sleep);

          // wait the appropriate amount of time before retrying the request
          setTimeout(sendRequest, sleep * 1000);
        }
        else
        {
          // wrap the error into a network error
          err = Errors.createNetworkError(
            ErrorCodes.ERR_LARGE_RESULT_SET_NETWORK_COULD_NOT_CONNECT, err);
        }
      }
      // if the response contains xml, build an S3/Blob error from the response
      else if (response.getResponseHeader('Content-Type') ===
        'application/xml')
      {
        err = Errors.createLargeResultSetError(
          ErrorCodes.ERR_LARGE_RESULT_SET_RESPONSE_FAILURE, response);
      }

      // if we have an error, clear the body
      if (err)
      {
        body = null;
      }

      // if a callback was specified, invoke it
      if (Util.isFunction(options.callback))
      {
        options.callback(err, body);
      }
    }
440282
function(err, result) {
      if (err && !util.isError(err)) {
        err = new Error(err);
      }
      if (callback) callback(err, result);
    }
629340
public void enqueue(@Nullable final Callback<T> callback) {
    checkIfExecuted();
    this.callback.set(callback);
    dispatcher.execute(new Runnable() {
      @Override public void run() {
        T result;
        try {
          result = perform();
        } catch (Exception e) {
          notifyFailure(new ApolloException("Failed to perform store operation", e));
          return;
        }

        notifySuccess(result);
      }
    });
  }
1168910
public void callback(final Callback callback)
    {
        Runnable runnable = new Runnable()
        {
            @Override
            public void run()
            {
                try
                {
                    callback.result(queryId, awaitResult());
                }
                catch (Exception e)
                {
                    callback.error(queryId, e);
                }
            }
        };
        EXECUTOR_SERVICE.submit(runnable);
    }
462368
@JsIgnore
  public static void onReady(Runnable callback) {
    if (isReady) {
      callback.run();
      return;
    }

    onReadyCallbacks.push(callback);
  }
921916
private void handleCallAsync(CallAsync callAsync) {
		try {
			Object result = callAsync.getCallable().call();

			getSender().tell(new Status.Success(result), getSelf());
		} catch (Throwable e) {
			getSender().tell(new Status.Failure(e), getSelf());
		}
	}
261520
def error_future(self):
        
        fut = asyncio.Future(loop=self._loop)
        self._error_futures.append(fut)
        return fut
278286
public void deliverError(JusError error) {
        synchronized (errorListeners) {
            for (RequestListener.ErrorListener errorListener : errorListeners) {
                errorListener.onError(error);
            }
            errorListeners.clear();
        }
        synchronized (responseListeners) {
            responseListeners.clear();
        }
    }