Exception from the resilience policy. We have two exceptions now. One from the loader or the expiry policy,
one from the resilience policy. We propagate the more severe one from the resilience policy.
438609
private void resiliencePolicyException(final Entry<K, V> e, final long t0, final long t, Throwable _exception) {
    ExceptionWrapper<K> _value = new ExceptionWrapper(extractKeyObj(e), _exception, t0, e);
    insert(e, (V) _value, t0, t, t0, INSERT_STAT_LOAD, 0);
  }
1278310
async def handle_exception(self, error: Exception) -> Response:
        
        await got_request_exception.send(self, exception=error)

        self.log_exception(sys.exc_info())

        if self.propagate_exceptions:
            return await traceback_response()

        internal_server_error = all_http_exceptions[500]()
        handler = self._find_exception_handler(internal_server_error)

        if handler is None:
            return internal_server_error.get_response()
        else:
            return await self.finalize_request(await handler(error), from_error_handler=True)
133949
public void handleExceptionRead(Exception e)
      {
        final String mName = "handleExceptionRead";
        
        logger.finer("RETRYHANDLE: in retryhandler handle exception on a read:" + e.toString());

        if(logger.isLoggable(Level.FINER)) 
          logger.logp(Level.FINE, className, mName, e.getClass().getName() + "; " + this.toString());
        
        if (!isRetryLimitReached() && excMatcher.isSkippableOrRetryable(e))
        {
           retryType = RETRY_READ;
           _retryException = e;
          // Retry it.  Log it.  Call the RetryListener.
          ++_retryCount;
          logRetry(e);

          if (_retryReadListeners != null) {
              for (RetryReadListenerProxy retryReadListenerProxy : _retryReadListeners) {
                  retryReadListenerProxy.onRetryReadException(e);
                }
          }
        }
        else
        {
          // No retry.  Throw it back.
          if(logger.isLoggable(Level.FINER)) 
            logger.logp(Level.FINE, className, mName, "No retry.  Rethrow", e);
            throw new BatchContainerRuntimeException(e);
        }

        if(logger.isLoggable(Level.FINER)) 
          logger.exiting(className, mName, e);
      }
445721
def dispatch_failed(self, context):
        """"""
        traceback.print_exception(
            context.exc_type, context.exc_value, context.traceback)
        raise SystemExit(1)
479263
private void exception(Throwable e)
    {
        try
        {
            _persistent=false;
            int error_code=HttpResponse.__500_Internal_Server_Error;
            
            if (e instanceof HttpException)
            {
                error_code=((HttpException)e).getCode();
                
                if (_request==null)
                    log.warn(e.toString());
                else
                    log.warn(_request.getRequestLine()+" "+e.toString());
                log.debug(LogSupport.EXCEPTION,e);
            }
            else if (e instanceof EOFException)
            {
                LogSupport.ignore(log,e);
                return;
            }
            else
            {
                _request.setAttribute("javax.servlet.error.exception_type",e.getClass());
                _request.setAttribute("javax.servlet.error.exception",e);
                
                if (_request==null)
                    log.warn(LogSupport.EXCEPTION,e);
                else
                    log.warn(_request.getRequestLine(),e);
            }
            
            if (_response != null && !_response.isCommitted())
            {
                _response.reset();
                _response.removeField(HttpFields.__TransferEncoding);
                _response.setField(HttpFields.__Connection,HttpFields.__Close);
                _response.sendError(error_code);
            }
        }
        catch(Exception ex)
        {
            LogSupport.ignore(log,ex);
        }
    }
311625
def remote_exception(exc, tb):
    
    if type(exc) in exceptions:
        typ = exceptions[type(exc)]
        return typ(exc, tb)
    else:
        try:
            typ = type(exc.__class__.__name__,
                       (RemoteException, type(exc)),
                       {'exception_type': type(exc)})
            exceptions[type(exc)] = typ
            return typ(exc, tb)
        except TypeError:
            return exc
89719
private void handleExceptions() throws RetriesExhaustedWithDetailsException {
    RetriesExhaustedWithDetailsException exceptions = getExceptions();
    if (exceptions != null) {
      listener.onException(exceptions, this);
    }
  }
420664
def error(self, exc):
        
        msg = 'trying to execute a step in the environment: \n' \
              '           - Exception: %s' % exc
        if self.logger is not None:
            self.logger.error(msg)
        self.by_console('      ERROR - %s' % msg)
588576
def forward_exception(self, etype, evalue, tb):
        
        self._excepthook(etype, evalue, tb)
1073049
public static void setConfigException(Throwable e)
  {
    ClassLoader loader = Thread.currentThread().getContextClassLoader();

    for (; loader != null; loader = loader.getParent()) {
      if (loader instanceof EnvironmentClassLoader) {
        EnvironmentClassLoader envLoader = (EnvironmentClassLoader) loader;

        envLoader.setConfigException(e);

        return;
      }
    }
  }
1116787
protected Throwable relaunch(ClassLoader classLoader) throws Exception {
		RestartLauncher launcher = new RestartLauncher(classLoader, this.mainClassName,
				this.args, this.exceptionHandler);
		launcher.start();
		launcher.join();
		return launcher.getError();
	}
877137
def exception_handling(exception_handler, control)
      begin
        yield
      
      rescue => exception
        # If we have an exception handler, it gets handed all the exceptions. 
        # No exceptions stop the operation. 
        if exception_handler
          exception_handler.call(exception, control)
        else
          raise
        end
      end
    end
554783
def raise_exception(self, original_exception=None):
        
        if self._executed_retries < self._max_retries:
            curr_backoff = self._ms_backoff
            self._executed_retries += 1
            self._ms_backoff = self._ms_backoff * 2
            raise ActionRetryException(curr_backoff)
        else:
            raise original_exception or Exception()
1185353
protected boolean isHostUnavailableException(Throwable throwable, Set<Throwable> path) {
    // Check if the exception is an IOException and check if the
    // message indicates an end of stream on a Connection.
    if ( IOException.class.isInstance(throwable) && throwable.getMessage().contains("unexpected end of stream on") ) {
      return true;
    }
    // we need to check our recursion path to avoid infinite recursion if a
    // getCause() pointed to itself or an ancestor
    if ( throwable.getCause() != null && !path.contains(throwable.getCause()) ) {
      path.add(throwable.getCause());
      boolean isCauseHostUnavailableException = isHostUnavailableException(throwable.getCause(), path);
      if ( isCauseHostUnavailableException == true )
        return true;
    }
    return false;
  }
571884
protected void propagateException(ActivityExecution execution, Exception ex) throws Exception {
    BpmnError bpmnError = checkIfCauseOfExceptionIsBpmnError(ex);
    if (bpmnError != null) {
      propagateBpmnError(bpmnError, execution);
    } else {
      propagateExceptionAsError(ex, execution);
    }
  }
375134
public RetryInterceptorBuilder<T> retryPolicy(RetryPolicy policy) {
		Assert.isNull(this.retryOperations,
				"cannot set the retry policy when a custom retryOperations has been set");
		Assert.isTrue(!this.templateAltered,
				"cannot set the retry policy if max attempts or back off policy or options changed");
		this.retryTemplate.setRetryPolicy(policy);
		this.retryPolicySet = true;
		this.templateAltered = true;
		return this;
	}
890561
private void handleLifecycleTransitionFailure(Throwable t) {
      if (t.getCause() != null && t.getCause() instanceof CacheConfigurationException)
         throw (CacheConfigurationException) t.getCause();
      else if (t.getCause() != null && t.getCause() instanceof InvocationTargetException && t.getCause().getCause() != null && t.getCause().getCause() instanceof CacheConfigurationException)
         throw (CacheConfigurationException) t.getCause().getCause();
      else if (t instanceof CacheException)
         throw (CacheException) t;
      else if (t instanceof RuntimeException)
         throw (RuntimeException) t;
      else if (t instanceof Error)
         throw (Error) t;
      else
         throw new CacheException(t);
   }