@Override public void run() { Serializable result; try { result = execute(); } catch (Exception e) { try { Method method = ReflectionUtils.getAnyMethod(getClass(), "execute"); if (!ReflectionUtils.hasDeclaredException(method, e)) { LOGGER.error("Command failed due to a bug, please contact support@dcache.org.", e); e = new CommandPanicException("Command failed: " + e, e); } } catch (NoSuchMethodException suppressed) { e.addSuppressed(suppressed); } result = e; } reply(result); } }
if (!ReflectionUtils.hasDeclaredException(method, e)) { throw new CommandPanicException("Command failed: " + e.toString(), e);