loggingLevel = Level.INFO; realCause.setStackTrace(ExceptionHelper.filterStackTrace(realCause.getStackTrace())); return (RemoteException) cause;
/** * Creates the stackdump string for the whole application. * <p> * Useful for debugging, crash analysis. * * @return the stackdump */ public String createStackDump() { StringBuilder buf = new StringBuilder("\n-------------------- Stackdump "); buf.append(dumpCount.incrementAndGet()) .append(" --------------------\n\n"); try { doCreateStackDump(buf); } catch (RuntimeException ex) { buf.append("CREATING STACKDUMP FAILED:\n") .append(ExceptionHelper.getStackTraceAsString(ex)); } buf.append("\n-------------------- End Of Stackdump ") .append(dumpCount) .append(" --------------------\n\n"); return buf.toString(); }
/** * Filters a given stacktrace skipping all noisy elements without relevant information for the developer. * * @param trace the stacktrace * @return the reduced stacktrace */ public static StackTraceElement[] filterStackTrace(StackTraceElement[] trace) { List<StackTraceElement> stackList = new ArrayList<>(); if (trace != null && trace.length > 0) { boolean valuableFound = false; for (StackTraceElement elem: trace) { boolean valuable = isClassValuableForStackTrace(elem.getClassName()); if (valuable || !valuableFound) { stackList.add(elem); } if (valuable) { valuableFound = true; } } } trace = new StackTraceElement[stackList.size()]; stackList.toArray(trace); return trace; }
if (ExceptionHelper.extractException(BindException.class, true, ex) == null) { throw ex; // some other exception
if (!ExceptionHelper.handleException(true, t, new ExceptionHelper.Handler<ReconnectedException>(ReconnectedException.class, rx -> {
if (txVoucher != 0 && ExceptionHelper.extractException(PersistenceException.class, true, ex) != null) {
if (txVoucher != 0 && ExceptionHelper.extractException(PersistenceException.class, true, ex) != null) {
ValidationFailedException vx = ExceptionHelper.extractException(ValidationFailedException.class, true, rex); String msg; if (vx == null) { BindingVetoException bve = ExceptionHelper.extractException(BindingVetoException.class, true, rex); if (bve == null) { // extended component log only if not a rethrown veto exception LOGGER.severe("update model failed for " + FxUtilities.getInstance().dumpComponentHierarchy(getNode()), rex);
boolean withLog = ExceptionHelper.extractException(PersistenceException.class, true, cause) != null; if (!rollback(transaction.getTxVoucher(), withLog)) { throw new PersistenceException(this, transaction + " not rolled back despite valid voucher");