Handles exceptions either by logging and swalling or by rethrowing as
{@code RuntimeException} depending on the value of {@code _swallowException}.

@param e An instance of <code>Exception</code>.
180389
protected void handleException(final Exception e) {
        if (_swallowException) {
            _logger.warn("Metrics collection failed.", e);
        } else {
            if (e instanceof RuntimeException) {
                throw (RuntimeException) e;
            } else {
                throw new RuntimeException(e);
            }
        }
    }
652402
public void handleExceptionProcess(Exception e, Object w)
      {
        final String mName = "handleExceptionProcess";
        
        if(logger.isLoggable(Level.FINER)) 
          logger.logp(Level.FINE, className, mName, e.getClass().getName() + "; " + this.toString());
        
        if (!isRetryLimitReached() && excMatcher.isSkippableOrRetryable(e))
        {
          retryType = RETRY_PROCESS;
          _retryException = e;
          // Retry it.  Log it.  Call the RetryListener.
          ++_retryCount;
          logRetry(e);

          if (_retryProcessListeners != null) {
              for (RetryProcessListenerProxy retryProcessListenerProxy : _retryProcessListeners) {
                  retryProcessListenerProxy.onRetryProcessException(w, 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);
        }
      }
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);
			}
		}
	}
69983
public static void exception(Object o, TraceComponent tc, Exception e) {
    if(isTracing()) SibTr.exception(o, tc, e);

  }
138506
private static ReflectionException handleException(String methodName, InvocationTargetException e) {
        LOGGER.error("Couldn't invoke method " + methodName, e);
        return new ReflectionException(e);
    }
595796
private void handleException(final Throwable e) {

        if (e instanceof ServiceException) {
            final ServiceException se = (ServiceException) e;
            // Only log with warn level to let the application continue its workflow even in developer mode
            LOGGER.log(SERVICE_TASK_EXCEPTION, se, se.getExplanation(), getServiceHandlerName());
        } else {
            // In developer mode it will stop the application throwing another exception
            LOGGER.log(SERVICE_TASK_ERROR, e, getServiceHandlerName());
        }

        this.wave.status(Status.Failed);

        final Class<? extends Throwable> managedException = e instanceof ServiceException ? e.getCause().getClass() : e.getClass();

        // Get the exact exception type
        final Wave exceptionHandlerWave = this.wave.waveType().waveExceptionHandler().get(managedException);

        if (exceptionHandlerWave != null) {
            // Fill the wave with useful data
            exceptionHandlerWave.fromClass(this.service.getClass())
                                .add(JRebirthItems.exceptionItem, e)
                                .add(JRebirthItems.waveItem, this.wave)
                                .relatedWave(this.wave);

            LOGGER.log(SERVICE_TASK_HANDLE_EXCEPTION, e, e.getClass().getSimpleName(), getServiceHandlerName());

            // Send the exception wave to interested components
            this.service.sendWave(exceptionHandlerWave);
        } else {
            LOGGER.log(SERVICE_TASK_NOT_MANAGED_EXCEPTION, e, e.getClass().getSimpleName(), getServiceHandlerName());
        }
    }
1125072
private void handleExceptions(Subroutine subroutine, InstructionHandle pei, BasicBlock etb) {
        etb.setExceptionThrower(pei);

        // Remember whether or not a universal exception handler
        // is reachable. If so, then we know that exceptions raised
        // at this instruction cannot propagate out of the method.
        boolean sawUniversalExceptionHandler = false;

        List<CodeExceptionGen> exceptionHandlerList = exceptionHandlerMap.getHandlerList(pei);
        if (exceptionHandlerList != null) {
            for (CodeExceptionGen exceptionHandler : exceptionHandlerList) {
                InstructionHandle handlerStart = exceptionHandler.getHandlerPC();
                subroutine.addEdgeAndExplore(etb, handlerStart, HANDLED_EXCEPTION_EDGE);

                if (Hierarchy.isUniversalExceptionHandler(exceptionHandler.getCatchType())) {
                    sawUniversalExceptionHandler = true;
                }
            }
        }

        // If required, mark this block as throwing an unhandled exception.
        // For now, we assume that if there is no reachable handler that handles
        // ANY exception type, then the exception can be thrown out of the
        // method.
        if (!sawUniversalExceptionHandler) {
            if (DEBUG) {
                System.out.println("Adding unhandled exception edge from " + pei);
            }
            subroutine.setUnhandledExceptionBlock(etb);
        }
    }
994268
public static RuntimeException asRuntimeException(Exception e) {
        if (e instanceof RuntimeException) {
            return (RuntimeException) e;
        }
        return UnexpectedMethodInvocationException.triage(e);
    }
629801
public void         takeException(Exception exception) throws Exception
    {
        boolean     rethrow = true;
        if ( isRetryException(exception) )
        {
            if ( !Boolean.getBoolean(DebugUtils.PROPERTY_DONT_LOG_CONNECTION_ISSUES) )
            {
                log.debug("Retry-able exception received", exception);
            }

            if ( retryPolicy.allowRetry(retryCount++, System.currentTimeMillis() - startTimeMs, sleeper) )
            {
                new EventTrace("retries-allowed", tracer.get()).commit();
                if ( !Boolean.getBoolean(DebugUtils.PROPERTY_DONT_LOG_CONNECTION_ISSUES) )
                {
                    log.debug("Retrying operation");
                }
                rethrow = false;
            }
            else
            {
                new EventTrace("retries-disallowed", tracer.get()).commit();
                if ( !Boolean.getBoolean(DebugUtils.PROPERTY_DONT_LOG_CONNECTION_ISSUES) )
                {
                    log.debug("Retry policy not allowing retry");
                }
            }
        }

        if ( rethrow )
        {
            throw exception;
        }
    }
111495
public void handleException(Throwable throwable) {
        log.debug("Handle exception: {} with: {}", throwable.getMessage(), exceptionHandler);
        if (exceptionHandler != null) {
            exceptionHandler.handleException(throwable);
        } else {
            log.error("Connection exception", throwable);
            throw new RuntimeException(throwable);
        }
    }
295907
private static void throwRuntimeException(String msg, InvocationTargetException e) {
    Throwable cause = e.getCause();
    if (cause != null) {
      throw new RuntimeException(msg + ": " + cause.getMessage(), cause);
    } else {
      throw new RuntimeException(msg + ": " + e.getMessage(), e);
    }
  }
25883
protected static StringBuilder handleExceptionStart(Exception e) {
        LOG.warning(ExceptionUtils.getStackTrace(e));
        StringBuilder sb = new StringBuilder();
        if (e.getMessage() != null) {
            sb.append(e.getMessage()).append(". ");
        }
        if (e.getCause() != null && e.getCause().getMessage() != null) {
            sb.append(e.getCause().getMessage()).append(". ");
        }
        return sb;
    }
1009526
synchronized void error(@NotNull Exception e) {
        if (isFinished) {
            throw new RuntimeException("Promise already completed!");
        }
        if (e == null) {
            throw new RuntimeException("Error can't be null");
        }
        isFinished = true;
        exception = e;
        deliverResult();
    }
1263784
public static void exception(TraceComponent tc, Exception e) {
    if(isTracing()) SibTr.exception(tc, e);

  }
458964
@Override
    public void setException(Exception e) {
        if (!isTerminated()) {
            subject.onError(e);
        } else {
            throw new IllegalStateException("Response has already terminated so exception can not be set", e);
        }
    }
582434
protected void finishSendError(Exception e) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "finishSendError(exception): " + getVC());
        }
        WsByteBuffer[] body = (WsByteBuffer[]) getVC().getStateMap().remove(EPS_KEY);
        if (null != body) {
            for (int i = 0; i < body.length && null != body[i]; i++) {
                body[i].release();
            }
        }
        this.myLink.close(getVC(), e);
    }
749892
void handleBreach(Exception e, Class[] classesStack) {
        String subject = "Izou Security Exception: " + e.getMessage();
        sendErrorReport(subject, e, classesStack);
    }