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);
|
ImageUtil.writeJpeg(thumbnail, outputStream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Throwable e) {
|
||||||
log.error("Unable to generate thumbnails for: " + file, e);
|
log.error("Unable to generate thumbnails for: " + file, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extract text content from the file
|
// Extract text content from the file
|
||||||
long startTime = System.currentTimeMillis();
|
long startTime = System.currentTimeMillis();
|
||||||
String content = null;
|
String content = null;
|
||||||
log.error("Start extracting content from: " + file);
|
log.info("Start extracting content from: " + file);
|
||||||
try {
|
try {
|
||||||
content = formatHandler.extractContent(event.getLanguage(), event.getUnencryptedFile());
|
content = formatHandler.extractContent(event.getLanguage(), event.getUnencryptedFile());
|
||||||
} catch (Exception e) {
|
} catch (Throwable e) {
|
||||||
log.error("Error extracting content from: " + file, e);
|
log.error("Error extracting content from: " + file, e);
|
||||||
}
|
}
|
||||||
log.info(MessageFormat.format("File content extracted in {0}ms: " + file.getId(), System.currentTimeMillis() - startTime));
|
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 {
|
try {
|
||||||
BufferedReader reader = closer.register(new BufferedReader(new InputStreamReader(is)));
|
BufferedReader reader = closer.register(new BufferedReader(new InputStreamReader(is)));
|
||||||
for (String line = reader.readLine(); line != null; line = reader.readLine()) {
|
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) {
|
} catch (IOException x) {
|
||||||
// NOP
|
// NOP
|
||||||
|
Loading…
Reference in New Issue
Block a user