mirror of
https://github.com/sismics/docs.git
synced 2024-11-22 05:57:57 +01:00
handle all content extraction errors
This commit is contained in:
parent
d428e89c30
commit
cb29dcd6cc
@ -166,17 +166,17 @@ public class FileProcessingAsyncListener {
|
||||
ImageUtil.writeJpeg(thumbnail, outputStream);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
log.error("Unable to generate thumbnails for: " + file, e);
|
||||
}
|
||||
|
||||
// Extract text content from the file
|
||||
long startTime = System.currentTimeMillis();
|
||||
String content = null;
|
||||
log.error("Start extracting content from: " + file);
|
||||
log.info("Start extracting content from: " + file);
|
||||
try {
|
||||
content = formatHandler.extractContent(event.getLanguage(), event.getUnencryptedFile());
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
log.error("Error extracting content from: " + file, e);
|
||||
}
|
||||
log.info(MessageFormat.format("File content extracted in {0}ms: " + file.getId(), System.currentTimeMillis() - startTime));
|
||||
|
@ -34,7 +34,9 @@ public class InputStreamReaderThread extends Thread {
|
||||
try {
|
||||
BufferedReader reader = closer.register(new BufferedReader(new InputStreamReader(is)));
|
||||
for (String line = reader.readLine(); line != null; line = reader.readLine()) {
|
||||
logger.error(String.format(name + ": %s", line));
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug(String.format(name + ": %s", line));
|
||||
}
|
||||
}
|
||||
} catch (IOException x) {
|
||||
// NOP
|
||||
|
Loading…
Reference in New Issue
Block a user