This method is used when an asynchronous exception occurs and we want to send a message to
any associated exception listeners on this connection.

@param e The exception
358467
public void deliverAsyncException(Throwable e)
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "deliverAsyncException", e);

      if (proxyQueue != null)
      {
         proxyQueue.deliverException(e);
      }
      else
      {
         if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "** Odd - we are not async?!");
      }

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "deliverAsyncException");
   }
436914
@Override
    public void notifyException(Throwable exception)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "notifyException", new Object[] { this, exception });

        // If an asynch consumer is registered we need to let them know something went wrong
        if (_asynchConsumerRegistered)
            _asynchConsumer.notifyExceptionListeners(exception, _consumerSession);

        this.lock();
        try
        {
            if (_waiting)
            {
                // We need to get the exception back to the synchronous consumer
                _notifiedException = exception;
                _waiter.signal();
            }
        } finally
        {
            this.unlock();
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "notifyException");
    }
900909
protected final void sendError(Exception e, StaplerRequest req, StaplerResponse rsp) throws ServletException, IOException {
        sendError(e.getMessage(),req,rsp);
    }
1246827
public Exception setExceptionIfResponseNotReceived(Exception e, String exceptionMessage) {
        Exception exception = e;

        if (!valueSet.get() && !isTerminated()) {
            if (e == null) {
                exception = new IllegalStateException(exceptionMessage);
            }
            setExceptionIfResponseNotReceived(exception);
        }
        // return any exception that was generated
        return exception;
    }
1154424
public void setConfigException(Exception e)
  {
    log.log(Level.FINER, e.toString(), e);
  }
994268
public static RuntimeException asRuntimeException(Exception e) {
        if (e instanceof RuntimeException) {
            return (RuntimeException) e;
        }
        return UnexpectedMethodInvocationException.triage(e);
    }
75767
public static void queueException(final Throwable e) {
		if (e != null) {
			try {
				LogAppender<LogEvent> appender = LogManager.getAppender();
	
				if (appender != null) {
					appender.append(LogEvent.newBuilder().level("ERROR").message(e.getMessage()).exception(e).build());
				}
			} catch (Throwable t) {
				LOGGER.info("Unable to queue exception to Stackify Log API service: {}", e, t);
			}
		}
	}
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);
        }
    }
680324
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception {
        Throwable cause = e.getCause();

        // do not print exception if it is BindException.
        // we are trying to search available port below 1024. It is not good to
        // print a flood
        // of error logs during the searching.
        if (cause instanceof java.net.BindException) {
            return;
        }

        LOG.error("Exception on connection to " + getRemoteAddress(), e.getCause());

        // close the channel unless we are connecting and it is
        // NotYetConnectedException
        if (!((cause instanceof NotYetConnectedException)
                && _connection.getConnectionState().equals(Connection.State.CONNECTING))) {
            ctx.getChannel().close();
        }
    }
69983
public static void exception(Object o, TraceComponent tc, Exception e) {
    if(isTracing()) SibTr.exception(o, tc, e);

  }
691911
private void throwQError(final QConnectorError e) {
		this.executor.execute(new Runnable() {
			
			@Override
			public void run() {
				QConnectorAsyncImpl.this.listener.error(e);
			}
		});
	}
877738
public static void error(Throwable e) throws JMapperException{
		logger.error("{}: {}",e.getClass().getSimpleName(),e.getMessage());
		throw new JMapperException(e);
	}
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);
      }
1239646
protected final void notifyError(@NonNull final Throwable e) {
        //noinspection ThrowableResultOfMethodCallIgnored
        checkNotNull(e, "e");
        runOnUiThread(new Runnable() {
            @Override
            public void run() {
                mErrorObservable.notifyError(e);
            }
        });
    }
557443
private void handleContextException(final ContextClientCodeException e) {

    LOG.log(Level.SEVERE, "ContextClientCodeException", e);

    final ByteString exception = ByteString.copyFrom(this.exceptionCodec.toBytes(e.getCause()));

    final ReefServiceProtos.ContextStatusProto.Builder contextStatusBuilder =
        ReefServiceProtos.ContextStatusProto.newBuilder()
            .setContextId(e.getContextID())
            .setContextState(ReefServiceProtos.ContextStatusProto.State.FAIL)
            .setError(exception);

    if (e.getParentID().isPresent()) {
      contextStatusBuilder.setParentId(e.getParentID().get());
    }

    final ReefServiceProtos.ContextStatusProto contextStatus = contextStatusBuilder.build();

    LOG.log(Level.SEVERE, "Sending heartbeat: {0}", contextStatus);

    this.heartBeatManager.sendContextStatus(contextStatus);
  }
379590
@Override
	public void log(Exception e, Object... elements) {
		StringBuilder sb = buildMsg(Level.ERROR, elements);
		context.log(sb.toString(),e);
	}
1199680
private EmoClientException asEmoClientException(UniformInterfaceException e)
            throws EmoClientException {
        throw new EmoClientException(e.getMessage(), e, toEmoResponse(e.getResponse()));
    }