private static void logProcessingFailure(Processing processing, Exception exception) { //LOGGING ONLY: String errorMsg = processing + " failed at " + processing.callStack().getLastPopped(); if (exception != null) { if (exception instanceof HandledProcessingException) { errorMsg += ". Error message: " + exception.getMessage(); log.log(Level.WARNING, errorMsg); log.log(Level.FINE, "Chained exception:", exception); } else { log.log(Level.WARNING, errorMsg, exception); } } else { log.log(Level.WARNING, errorMsg); } //LOGGING OF STACK TRACE: if (exception != null) { StringWriter backtrace = new StringWriter(); exception.printStackTrace(new PrintWriter(backtrace)); log.log(LogLevel.DEBUG, "Failed to process " + processing + ": " + backtrace.toString()); } }
final String location; if (processing != null) { final CallStack callStack = processing.callStack(); if (callStack != null) { final Call lastPopped = callStack.getLastPopped();
processingFailed(processing, processing + " failed at " + processing.callStack().getLastPopped(), null); return true; } else if (DocumentProcessor.Progress.PERMANENT_FAILURE.equals(progress)) { processingFailed(processing, processing + " failed PERMANENTLY at " + processing.callStack().getLastPopped() + ", disabling processing service.", null); setInService(false); return true;