Throws an exception if e is not of the correct type for this enum set.
320929
final void typeCheck(E e) {
        Class<?> eClass = e.getClass();
        if (eClass != elementType && eClass.getSuperclass() != elementType)
            throw new ClassCastException(eClass + " != " + elementType);
    }
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;
      }
    }
  }
673005
void error(int e) {
        String s = "Error " + e + " at line " + fLineNum + " column "
                + fCharNum;
        IllegalArgumentException ex = new IllegalArgumentException(s);
        throw ex;

    }
1090656
public void setExceptionType(String exceptionType) {
		if (exceptionType != null) {
			NullArgumentException.validateNotEmpty(exceptionType, "Error code");
		}
		this.exceptionType = exceptionType;
	}
609851
public void setText(Exception e) {
		StringWriter wr = new StringWriter();
		PrintWriter pr = new PrintWriter(wr);
		e.printStackTrace(pr);
		this.setText(wr.toString());
	}
1005438
public static String formatException(final Exception e) {
    final StringBuilder sb = new StringBuilder();
    Throwable t = e;
    while (t != null) {
      sb.append(t.getMessage()).append("\n");
      t = t.getCause();
    }
    return sb.toString();
  }
522567
def logged_exception(self, e):
        
        if str(e) not in self._errors:
            self._errors.append(str(e))

        self.set_error_state()
        self.buildstate.state.exception_type = str(e.__class__.__name__)
        self.buildstate.state.exception = str(e)
1071461
public static void exception(String message, Throwable e) {
    if(message == null && e != null) {
      message = e.getMessage();
    }
    logExpensive(Level.SEVERE, message, e);
  }
596208
protected BpmnError checkIfCauseOfExceptionIsBpmnError(Throwable e) {
    if (e instanceof BpmnError) {
      return (BpmnError) e;
    } else if (e.getCause() == null) {
      return null;
    }
    return checkIfCauseOfExceptionIsBpmnError(e.getCause());
  }
1017449
private boolean isJsonProcessingException(Exception e) {
        // Unfortunately Jackson doesn't have specific subclasses for each parse exception, so we have to use the
        // more brittle approach of checking the exception message.
        return e instanceof JsonProcessingException &&
                !(e instanceof JsonParseException &&
                    e.getMessage() != null &&
                    e.getMessage().startsWith("Unexpected end-of-input"));
    }
622574
@FFDCIgnore(ClassNotFoundException.class)
	public boolean isSkippableOrRetryable(Exception e) {
		final String mName = "isSkippableOrRetryable";
		String exClassName = e.getClass().getName();
		
		boolean retVal = false;
		try {
			ClassLoader tccl = Thread.currentThread().getContextClassLoader();
			Class<?> excClass = tccl.loadClass(e.getClass().getName());
			exceptionHierarchy = new ArrayList<Object>();
			// Gets the List of Super Classes from excClass as the bottom
			getSuperClasses(excClass);
			
			boolean inExclude = isInElementSet(_skipExcludeExceptions, excClass);
			boolean inInclude = isInElementSet(_skipIncludeExceptions, excClass);
			
			if(inInclude && inExclude) {
				// If the Exception is in both elements, find which is the nearest tag
				// Find distance to nearest exclude
				int includeCount = getDistanceToElement(_skipIncludeExceptions);
				int excludeCount = getDistanceToElement(_skipExcludeExceptions);
				
				if(includeCount == excludeCount) {
				    retVal = false;
				} else if (includeCount < excludeCount) {
				    retVal = true;
				} else {
				    retVal = false;
				}
			} else if (inInclude && !inExclude) {
				// If inInclude = true and inExclude = false we will skip
			    retVal = true;
			} else {
				// Default Behavior
			    retVal = false;
			}
		} catch (ClassNotFoundException cnf) {
			logger.logp(Level.FINE, className, mName, cnf.getLocalizedMessage());				
		}
		
		if(logger.isLoggable(Level.FINE))
            logger.logp(Level.FINE, className, mName, mName+": " + retVal + ": " + exClassName);
		
		return retVal;
	}
46930
static void showError(Exception e) {
    String stackTrace = org.languagetool.tools.Tools.getFullStackTrace(e);
    String msg = "<html><p style='width: 600px;'>" + StringTools.escapeHTML(stackTrace);
    JOptionPane.showMessageDialog(null, msg, "Error", JOptionPane.ERROR_MESSAGE);
    e.printStackTrace();
  }
288606
private final void checkInvariants() throws Error {

        if (_lineBreak == null) {
            throw new Error("_lineBreak == null");
        } else if (_lineBreak == LineBreak.NONE && _indentation.length() > 0) {
            throw new Error("_lineBreak == LineBreak.NONE && _indentation = \"" + _indentation + "\".");
        } else if (_elementStack == null) {
            throw new Error("_elementStack (" + _elementStack + " == null");
        } else if (_elementStackSize < 0) {
            throw new Error("_elementStackSize (" + _elementStackSize + ") < 0");
        }
    }
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();
    }
895709
public boolean isClientError(IOException e) {
    GoogleJsonResponseException jsonException = getJsonResponseExceptionOrNull(e);
    if (jsonException != null) {
      return (getHttpStatusCode(jsonException)) / 100 == 4;
    }
    return false;
  }
192256
private static boolean mySqlErrorCodeMatches(Exception e, int errorCode)
    {
        return Throwables.getCausalChain(e).stream()
                .filter(SQLException.class::isInstance)
                .map(SQLException.class::cast)
                .filter(t -> t.getErrorCode() == errorCode)
                .map(Throwable::getStackTrace)
                .anyMatch(isMySQLException());
    }
524551
protected boolean fail(Throwable e) {
        if (done.compareAndSet(false, true)) {
            onErrorCore(e);
            return true;
        }
        return false;
    }