Throw <code>this</code> if packed exception is not instanceof among
given classes

@param classes throw when doesn't matches all these classes
437772
public void throwNotIn(@SuppressWarnings("unchecked") Class<? extends Throwable>... classes) {
                boolean toThrow = true;
                for (Class<? extends Throwable> cls : classes) {
                        if (cls.isInstance(super.getCause())) {
                                toThrow = false;
                                break;
                        }
                }
                if (toThrow) {
                        throw this;
                }
        }
396728
@Private
  @Override
  public void threwException(final int taskletId, final Exception exception) {
    try {
      failedTasklets(exception, Collections.singletonList(taskletId));
    } catch (final InterruptedException e) {
      throw new RuntimeException(e);
    }
  }
923951
public void setExceptions(java.util.Collection<RootCauseException> exceptions) {
        if (exceptions == null) {
            this.exceptions = null;
            return;
        }

        this.exceptions = new java.util.ArrayList<RootCauseException>(exceptions);
    }
40334
public static Object invokeNewN(Class senderClass, Class receiver, Object arguments) throws Throwable {
        try {
            return InvokerHelper.invokeConstructorOf(receiver, arguments);
        } catch (GroovyRuntimeException gre) {
            throw unwrap(gre);
        }
    }
718919
public <Ex extends Throwable> Try<R,Ex> execute(T input,Class<Ex> classes){
		
		return Try.withCatch( ()->transactionTemplate.execute(status-> transaction.apply(input)),classes);
		 
	}
957612
private void throwMultiEventException(Event<?> eventThatThrewException) {
        while(throwable instanceof MultiEventException && throwable.getCause() != null) {
            eventThatThrewException = ((MultiEventException) throwable).getEvent();
            throwable = throwable.getCause();
        }

        throw new MultiEventException(eventThatThrewException, throwable);
    }
1090948
@Override
	public void onUncaughtException(Throwable throwable) {
		for (ErrorHandler handler : this.errorHandlers) {
			if (handler.handle(throwable)) {
				return;
			}
		}
		this.defaultHandler.handle(throwable);
	}
36097
public static void registerSimpleType(String classes){
        if(StringUtil.isNotEmpty(classes)){
            String[] cls = classes.split(",");
            for (String c : cls) {
                try {
                    SIMPLE_TYPE_SET.add(Class.forName(c));
                } catch (ClassNotFoundException e) {
                    throw new MapperException("注册类型出错:" + c, e);
                }
            }
        }
    }
1281483
def catchable_exceptions(exceptions):
    
    if isinstance(exceptions, type) and issubclass(exceptions, BaseException):
        return True

    if (
        isinstance(exceptions, tuple)
        and exceptions
        and all(issubclass(it, BaseException) for it in exceptions)
    ):
        return True

    return False
830605
public void addClassesToCheck(Iterable<File> files) throws IOException {
    logger.info("Loading classes to check...");
    for (final File f : files) {
      addClassToCheck(f);
    }
  }
946051
public static boolean containsThrowableOfType(Throwable throwable, Class<?>... throwableTypes) {
        List<Throwable> alreadyProcessedThrowables = new ArrayList<Throwable>();
        while (true) {
            if (throwable == null) {
                // end of the list of causes
                return false;
            } else if (alreadyProcessedThrowables.contains(throwable)) {
                // infinite loop in causes
                return false;
            } else {
                for (Class<?> throwableType : throwableTypes) {
                    if (throwableType.isAssignableFrom(throwable.getClass())) {
                        return true;
                    }
                }
                alreadyProcessedThrowables.add(throwable);
                throwable = throwable.getCause();
            }
        }
    }
288937
public ObjectGraph excludeClasses(Class<?>... classes) {
    for (Class<?> c : classes) {
      if (c == null) {
        throw new NullPointerException("Null class not allowed");
      }
      excludedClasses.add(c);
    }
    return this;
  }
661447
private function throwExceptionIfNotInstantiable($class, $reflectionClass)
    {
        /*
         * Check if reflection class is not instantiable then throw ContainerException
         */
        if (!$reflectionClass->isInstantiable()) {
            $type = ($this->reflection->getReflectionClass()->isInterface() ? 'interface' : 'class');
            throw new ContainerException("Cannot instantiate $type $class");
        }
    }
1351802
public static <T extends Throwable> T convertFromOrSuppressedThrowable(Throwable throwable, Class<T> exceptionClass) {
		return convertFromOrSuppressedThrowable(throwable, exceptionClass, true);
	}
14923
@SuppressWarnings("unchecked")
	public static boolean isCausedBy(@Nullable Throwable throwable,
			Class<? extends Exception>... causeExceptionClasses) {
		Throwable cause = throwable;

		while (cause != null) {
			for (Class<? extends Exception> causeClass : causeExceptionClasses) {
				if (causeClass.isInstance(cause)) {
					return true;
				}
			}
			cause = cause.getCause();
		}
		return false;
	}
789880
private void propagateAsError(Throwable t) {
        if ( t instanceof InvocationTargetException) {
            t = t.getCause();   
        }
        if ( Error.class.isAssignableFrom(t.getClass())) {
            throw (Error)t;    
        }
        throw new PolledAssertionError(t);
    }
21236
private boolean isKnownException(@SlashedClassName String clsName) {
        for (String exceptionCls : knownExceptions) {
            if (clsName.startsWith(exceptionCls)) {
                return true;
            }
        }

        return false;
    }