public String toString() { String previousCall = ""; if (callStack != null) { Call call = callStack.getLastPopped(); if (call != null) { previousCall = "Last call: " + call; } } if (documentOperations.size() == 1) { return "Processing of " + documentOperations.get(0) + ". " + previousCall; } else { String listString = documentOperations.toString(); if (listString.length() > 100) { listString = listString.substring(0, 99); listString += "...]"; } return "Processing of " + listString + ". " + previousCall; } }
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 CallStack callStack = processing.callStack(); if (callStack != null) { final Call lastPopped = callStack.getLastPopped(); if (lastPopped != null) { location = lastPopped.toString();
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;