/** * Handles a fatal error thrown while asynchronously invoking the specified * {@link Method}. * <p>If the return type of the method is a {@link Future} object, the original * exception can be propagated by just throwing it at the higher level. However, * for all other cases, the exception will not be transmitted back to the client. * In that later case, the current {@link AsyncUncaughtExceptionHandler} will be * used to manage such exception. * @param ex the exception to handle * @param method the method that was invoked * @param params the parameters used to invoke the method */ protected void handleError(Throwable ex, Method method, Object... params) throws Exception { if (Future.class.isAssignableFrom(method.getReturnType())) { ReflectionUtils.rethrowException(ex); } else { // Could not transmit the exception to the caller with default executor try { this.exceptionHandler.obtain().handleUncaughtException(ex, method, params); } catch (Throwable ex2) { logger.warn("Exception handler for async method '" + method.toGenericString() + "' threw unexpected exception itself", ex2); } } }
/** * Handles a fatal error thrown while asynchronously invoking the specified * {@link Method}. * <p>If the return type of the method is a {@link Future} object, the original * exception can be propagated by just throwing it at the higher level. However, * for all other cases, the exception will not be transmitted back to the client. * In that later case, the current {@link AsyncUncaughtExceptionHandler} will be * used to manage such exception. * @param ex the exception to handle * @param method the method that was invoked * @param params the parameters used to invoke the method */ protected void handleError(Throwable ex, Method method, Object... params) throws Exception { if (Future.class.isAssignableFrom(method.getReturnType())) { ReflectionUtils.rethrowException(ex); } else { // Could not transmit the exception to the caller with default executor try { this.exceptionHandler.handleUncaughtException(ex, method, params); } catch (Throwable ex2) { logger.error("Exception handler for async method '" + method.toGenericString() + "' threw unexpected exception itself", ex2); } } }
/** * Handles a fatal error thrown while asynchronously invoking the specified * {@link Method}. * <p>If the return type of the method is a {@link Future} object, the original * exception can be propagated by just throwing it at the higher level. However, * for all other cases, the exception will not be transmitted back to the client. * In that later case, the current {@link AsyncUncaughtExceptionHandler} will be * used to manage such exception. * @param ex the exception to handle * @param method the method that was invoked * @param params the parameters used to invoke the method */ protected void handleError(Throwable ex, Method method, Object... params) throws Exception { if (Future.class.isAssignableFrom(method.getReturnType())) { ReflectionUtils.rethrowException(ex); } else { // Could not transmit the exception to the caller with default executor try { this.exceptionHandler.obtain().handleUncaughtException(ex, method, params); } catch (Throwable ex2) { logger.warn("Exception handler for async method '" + method.toGenericString() + "' threw unexpected exception itself", ex2); } } }