private static <T> T process(final Callable<T> task, final boolean throwException) throws Exception { Errors instance = errors.get(); if (instance == null) { instance = new Errors(); errors.set(instance); } instance.preProcess(); Exception caught = null; try { return task.call(); } catch (Exception re) { // If a runtime exception is caught then report errors and rethrow. caught = re; } finally { instance.postProcess(throwException && caught == null); } throw caught; }
private static <T> T process(final Callable<T> task, final boolean throwException) throws Exception { Errors instance = errors.get(); if (instance == null) { instance = new Errors(); errors.set(instance); } instance.preProcess(); Exception caught = null; try { return task.call(); } catch (Exception re) { // If a runtime exception is caught then report errors and rethrow. caught = re; } finally { instance.postProcess(throwException && caught == null); } throw caught; }
private static <T> T process(final Callable<T> task, final boolean throwException) throws Exception { Errors instance = errors.get(); if (instance == null) { instance = new Errors(); errors.set(instance); } instance.preProcess(); Exception caught = null; try { return task.call(); } catch (Exception re) { // If a runtime exception is caught then report errors and rethrow. caught = re; } finally { instance.postProcess(throwException && caught == null); } throw caught; }
private static <T> T process(final Callable<T> task, final boolean throwException) throws Exception { Errors instance = errors.get(); if (instance == null) { instance = new Errors(); errors.set(instance); } instance.preProcess(); Exception caught = null; try { return task.call(); } catch (Exception re) { // If a runtime exception is caught then report errors and rethrow. caught = re; } finally { instance.postProcess(throwException && caught == null); } throw caught; }
private static <T> T process(final Callable<T> task, final boolean throwException) throws Exception { Errors instance = errors.get(); if (instance == null) { instance = new Errors(); errors.set(instance); } instance.preProcess(); Exception caught = null; try { return task.call(); } catch (Exception re) { // If a runtime exception is caught then report errors and rethrow. caught = re; } finally { instance.postProcess(throwException && caught == null); } throw caught; }
private static <T> T process(final Callable<T> task, final boolean throwException) throws Exception { Errors instance = errors.get(); if (instance == null) { instance = new Errors(); errors.set(instance); } instance.preProcess(); Exception caught = null; try { return task.call(); } catch (Exception re) { // If a runtime exception is caught then report errors and rethrow. caught = re; } finally { instance.postProcess(throwException && caught == null); } throw caught; }
private static <T> T process(final Callable<T> task, final boolean throwException) throws Exception { Errors instance = errors.get(); if (instance == null) { instance = new Errors(); errors.set(instance); } instance.preProcess(); Exception caught = null; try { return task.call(); } catch (Exception re) { // If a runtime exception is caught then report errors and rethrow. caught = re; } finally { instance.postProcess(throwException && caught == null); } throw caught; }