The default {@link ExceptionCallback} which simply logs any failure but
takes no further action.

@return The callback.
328520
public static ExceptionCallback ignore() {
        return new ExceptionCallback() {
            @Override
            public void exception(FailedEventInvocation invocation) {
                FailedEventInvocation.log(LOG, invocation);
            }
        };
    }
523469
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
        List<Callback> toRespondTo = new LinkedList<Callback>();

        String userName = null;
        boolean userFound = false;

        Properties users = getProperties();

        // A single pass may be sufficient but by using a two pass approach the Callbackhandler will not
        // fail if an unexpected order is encountered.

        // First Pass - is to double check no unsupported callbacks and to retrieve
        // information from the callbacks passing in information.
        for (Callback current : callbacks) {

            if (current instanceof AuthorizeCallback) {
                toRespondTo.add(current);
            } else if (current instanceof NameCallback) {
                NameCallback nameCallback = (NameCallback) current;
                userName = nameCallback.getDefaultName();
                userFound = users.containsKey(userName);
            } else if (current instanceof PasswordCallback && plainText) {
                toRespondTo.add(current);
            } else if (current instanceof CredentialCallback) {
                toRespondTo.add(current);
            } else if (current instanceof EvidenceVerifyCallback && ((EvidenceVerifyCallback)current).getEvidence() instanceof PasswordGuessEvidence) {
                toRespondTo.add(current);
            } else if (current instanceof RealmCallback) {
                String realm = ((RealmCallback) current).getDefaultText();
                if (this.realm.equals(realm) == false) {
                    throw DomainManagementLogger.ROOT_LOGGER.invalidRealm(realm, this.realm);
                }
            } else {
                throw new UnsupportedCallbackException(current);
            }
        }

        // Second Pass - Now iterate the Callback(s) requiring a response.
        for (Callback current : toRespondTo) {
            if (current instanceof AuthorizeCallback) {
                AuthorizeCallback acb = (AuthorizeCallback) current;
                boolean authorized = acb.getAuthenticationID().equals(acb.getAuthorizationID());
                if (authorized == false) {
                    SECURITY_LOGGER.tracef(
                            "Checking 'AuthorizeCallback', authorized=false, authenticationID=%s, authorizationID=%s.",
                            acb.getAuthenticationID(), acb.getAuthorizationID());
                }
                acb.setAuthorized(authorized);
            } else if (current instanceof PasswordCallback) {
                if (userFound == false) {
                    SECURITY_LOGGER.tracef("User '%s' not found in properties file.", userName);
                    throw new UserNotFoundException(userName);
                }
                String password = users.get(userName).toString();
                ((PasswordCallback) current).setPassword(password.toCharArray());
            } else if (current instanceof CredentialCallback) {
                if (userFound == false) {
                    SECURITY_LOGGER.tracef("User '%s' not found in properties file.", userName);
                    throw new UserNotFoundException(userName);
                }

                CredentialCallback cc = (CredentialCallback) current;
                if (PasswordCredential.class.isAssignableFrom(cc.getCredentialType())) {
                    String algorithmName = cc.getAlgorithm();
                    final Password password;
                    if ((algorithmName == null || ALGORITHM_CLEAR.equals(algorithmName)) && plainText) {
                        password = ClearPassword.createRaw(ALGORITHM_CLEAR, ((String) users.get(userName)).toCharArray());
                    } else if ((algorithmName == null || ALGORITHM_DIGEST_MD5.equals(algorithmName)) && plainText == false) {
                        byte[] hashed = ByteIterator.ofBytes(((String) users.get(userName)).getBytes(StandardCharsets.UTF_8)).asUtf8String().hexDecode().drain();
                        password = DigestPassword.createRaw(ALGORITHM_DIGEST_MD5, userName, realm, hashed);
                    } else {
                        continue;
                    }
                    cc.setCredential(cc.getCredentialType().cast(new PasswordCredential(password)));
                }
            } else if (current instanceof EvidenceVerifyCallback) {
                if (userFound == false) {
                    SECURITY_LOGGER.tracef("User '%s' not found in properties file.", userName);
                    throw new UserNotFoundException(userName);
                }
                EvidenceVerifyCallback evc = (EvidenceVerifyCallback) current;
                PasswordGuessEvidence evidence = (PasswordGuessEvidence) evc.getEvidence();
                char[] guess = evidence.getGuess();
                if (plainText) {
                    String password = users.get(userName).toString();
                    boolean verified = password.equals(new String(guess));
                    if (verified == false) {
                        SECURITY_LOGGER.tracef("Password verification failed for user '%s'", userName);
                    }
                    evc.setVerified(verified);
                } else {
                    UsernamePasswordHashUtil hashUtil = getHashUtil();
                    String hash;
                    synchronized (hashUtil) {
                        hash = hashUtil.generateHashedHexURP(userName, realm, guess);
                    }
                    String expected = users.get(userName).toString();
                    boolean verified = expected.equals(hash);
                    if (verified == false) {
                        SECURITY_LOGGER.tracef("Digest verification failed for user '%s'", userName);
                    }
                    evc.setVerified(verified);
                }
            }
        }
    }
342124
public RetryerBuilder<V> retryIfExceptionOfType(@Nonnull Class<? extends Throwable> exceptionClass) {
        Preconditions.checkNotNull(exceptionClass, "exceptionClass may not be null");
        rejectionPredicate = Predicates.or(rejectionPredicate, new ExceptionClassPredicate<V>(exceptionClass));
        return this;
    }
280565
@ObjectiveCName("failure:")
    public synchronized Promise<T> failure(final Consumer<Exception> failure) {
        if (isFinished) {
            if (exception != null) {
                dispatcher.dispatch(() -> failure.apply(exception));
            }
        } else {

            callbacks.add(new PromiseCallback<T>() {
                @Override
                public void onResult(T t) {
                    // Do nothing
                }

                @Override
                public void onError(Exception e) {
                    failure.apply(e);
                }
            });
        }
        return this;
    }
861106
private ExecutionCallback<Boolean> loadingFinishedCallback() {
        return new ExecutionCallback<Boolean>() {
            @Override
            public void onResponse(Boolean loadingFinished) {
                if (loadingFinished) {
                    updateLocalKeyLoadStatus(null);
                }
            }

            @Override
            public void onFailure(Throwable t) {
                updateLocalKeyLoadStatus(t);
            }
        };
    }
70740
public JsonNode handleCallback(final Callback callback) {

        if (callback.getInvoke() != null) {
            return invokeCallbackMethod(callback.getInvoke(), callback.getCookie());
        } else if (callback.getGet() != null) {
            return invokeCallbackGet(callback.getGet());
        } else if (callback.getSet() != null) {
            return invokeCallbackSet(callback.getSet());
        }

        throw new JsiiException("Unrecognized callback type: get/set/invoke");
    }
315893
public static InvocationHandler defaultMethodHandler() {
    return (proxy, method, args) -> {
      if (method.isDefault()) {
        return MethodHandles.lookup()
            .in(method.getDeclaringClass())
            .unreflectSpecial(method, method.getDeclaringClass())
            .bindTo(proxy)
            .invokeWithArguments(args);
      } else {
        throw new IllegalArgumentException(method.toString());
      }
    };
  }
90253
def _exception_free_callback(self, callback, *args, **kwargs):
        
        try:
            return callback(*args, **kwargs)
        except Exception:
            self._logger.exception("An exception occurred while calling a hook! ",exc_info=True)
            return None
148397
public Fail<Flow<T>> getOrCreateFail()
   {
      List<Node> nodeList = childNode.get("fail");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new FailImpl<Flow<T>>(this, "fail", childNode, nodeList.get(0));
      }
      return createFail();
   }
1295333
@Override
  public void onFailure(WebSocket webSocket, Throwable t, Response response) {
    socketOpen = false;
    if (t instanceof Exception) {
      callback.onError((Exception) t);
    } else {
      callback.onError(new Exception(t));
    }
  }
460555
public static Class<?> getExceptionCallerClass(final Throwable t) {
		final StackTraceElement[] stackTrace = t.getStackTrace();
		for (final StackTraceElement stackTraceElement : stackTrace) {
			logger.debug(stackTraceElement.getClassName().concat(".").concat(stackTraceElement.getMethodName()));
		}
		return null;
	}
1211868
@Override
    public synchronized void addCallBack(RecoveryLogCallBack callback) {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "addCallBack", callback);

        if (_registeredCallbacks == null) {
            _registeredCallbacks = new HashSet<RecoveryLogCallBack>();
        }

        _registeredCallbacks.add(callback);

        if (tc.isEntryEnabled())
            Tr.exit(tc, "addCallBack");
    }
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);
            }
        };
    }
878028
protected <E extends Throwable> Set<ATError> handleException(E e, Log logger, 
			String key, String messageKey, String defaultMessagePrefix) {
		return handleException(e, logger, null, key, null, defaultMessagePrefix, new Object[] {});
	}
1282544
public final IntResultListener asIntResultListener ()
    {
        return new IntResultListener() {
            public void requestCompleted (int result) {
                // call the invocation method and it will do the unsafe cast for us.
                Resulting.this.requestProcessed((Object)result);
            }
            public void requestFailed (Exception cause) {
                Resulting.this.requestFailed(cause);
            }
        };
    }
105339
public Fault buildFault(Throwable ex) {
		Fault fault;
		int stacktracelength = configuration.getStacktracelength();
		if (stacktracelength == 0 || logger.isDebugEnabled()) {
			logger.error("Invocation failed", ex);
		}
		fault = new Fault(ex, stacktracelength);
		return fault;
	}
712544
public String getExceptionStackTrace() {
        Throwable t = getException();
        if (t == null) {
            return null;
        }
        StringWriter sw = new StringWriter();
        PrintWriter pw = new PrintWriter(sw);
        t.printStackTrace(pw);
        return sw.toString();
    }