/** * Runs the given runnable in a protected mode. Exceptions * thrown in the runnable are logged and passed to the runnable's * exception handler. Such exceptions are not rethrown by this method. * <p> * In addition to catching all {@link Exception} types, this method also catches certain {@link Error} * types that typically result from programming errors in the code being executed. * Severe errors that are not generally safe to catch are not caught by this method. * </p> * * @param code the runnable to run */ public static void run(ISafeRunnable code) { Assert.isNotNull(code); try { code.run(); } catch (Exception e) { handleException(code, e); } catch (LinkageError e) { handleException(code, e); } catch (AssertionError e) { handleException(code, e); } }
/** * Runs the given runnable in a protected mode. Exceptions * thrown in the runnable are logged and passed to the runnable's * exception handler. Such exceptions are not rethrown by this method. * <p> * In addition to catching all {@link Exception} types, this method also catches certain {@link Error} * types that typically result from programming errors in the code being executed. * Severe errors that are not generally safe to catch are not caught by this method. * </p> * * @param code the runnable to run */ public static void run(ISafeRunnable code) { Assert.isNotNull(code); try { code.run(); } catch (Exception e) { handleException(code, e); } catch (LinkageError e) { handleException(code, e); } catch (AssertionError e) { handleException(code, e); } }
/** * Runs the given runnable in a protected mode. Exceptions * thrown in the runnable are logged and passed to the runnable's * exception handler. Such exceptions are not rethrown by this method. * <p> * In addition to catching all {@link Exception} types, this method also catches certain {@link Error} * types that typically result from programming errors in the code being executed. * Severe errors that are not generally safe to catch are not caught by this method. * </p> * * @param code the runnable to run */ public static void run(ISafeRunnable code) { Assert.isNotNull(code); try { code.run(); } catch (Exception e) { handleException(code, e); } catch (LinkageError e) { handleException(code, e); } catch (AssertionError e) { handleException(code, e); } }
/** * Runs the given runnable in a protected mode. Exceptions * thrown in the runnable are logged and passed to the runnable's * exception handler. Such exceptions are not rethrown by this method. * <p> * In addition to catching all {@link Exception} types, this method also catches certain {@link Error} * types that typically result from programming errors in the code being executed. * Severe errors that are not generally safe to catch are not caught by this method. * </p> * * @param code the runnable to run */ public static void run(ISafeRunnable code) { Assert.isNotNull(code); try { code.run(); } catch (Exception e) { handleException(code, e); } catch (LinkageError e) { handleException(code, e); } catch (AssertionError e) { handleException(code, e); } }