Skip to content
Snippets Groups Projects
Commit 0435322a authored by srosse's avatar srosse
Browse files

no-jira: don't write the cause exception as a message of the DocumentException

parent 3947c257
No related branches found
No related tags found
No related merge requests found
...@@ -67,10 +67,10 @@ public class PdfDocument extends FileDocument { ...@@ -67,10 +67,10 @@ public class PdfDocument extends FileDocument {
} }
public static Document createDocument(SearchResourceContext leafResourceContext, VFSLeaf leaf) throws IOException,DocumentException,DocumentAccessException { public static Document createDocument(SearchResourceContext leafResourceContext, VFSLeaf leaf) throws IOException,DocumentException,DocumentAccessException {
PdfDocument textDocument = new PdfDocument(); PdfDocument textDocument = new PdfDocument();
textDocument.setFilePath(getPdfTextTmpFilePath(leafResourceContext)); textDocument.setFilePath(getPdfTextTmpFilePath(leafResourceContext));
textDocument.init(leafResourceContext,leaf); textDocument.init(leafResourceContext,leaf);
textDocument.setFileType(FILE_TYPE); textDocument.setFileType(FILE_TYPE);
textDocument.setCssIcon(CSSHelper.createFiletypeIconCssClassFor(leaf.getName())); textDocument.setCssIcon(CSSHelper.createFiletypeIconCssClassFor(leaf.getName()));
if (log.isDebug() ) log.debug(textDocument.toString()); if (log.isDebug() ) log.debug(textDocument.toString());
return textDocument.getLuceneDocument(); return textDocument.getLuceneDocument();
...@@ -98,7 +98,6 @@ public class PdfDocument extends FileDocument { ...@@ -98,7 +98,6 @@ public class PdfDocument extends FileDocument {
try { try {
String bean = externalIndexer ? "pdfExternalIndexer" : "pdfInternalIndexer"; String bean = externalIndexer ? "pdfExternalIndexer" : "pdfInternalIndexer";
PdfExtractor extractor = (PdfExtractor)CoreSpringFactory.getBean(bean); PdfExtractor extractor = (PdfExtractor)CoreSpringFactory.getBean(bean);
File pdfTextFile = new File(pdfTextBufferPath, getFilePath() + ".tmp"); File pdfTextFile = new File(pdfTextBufferPath, getFilePath() + ".tmp");
if (isNewPdfFile(leaf, pdfTextFile)) { if (isNewPdfFile(leaf, pdfTextFile)) {
//prepare dirs //prepare dirs
...@@ -114,7 +113,7 @@ public class PdfDocument extends FileDocument { ...@@ -114,7 +113,7 @@ public class PdfDocument extends FileDocument {
// pass exception // pass exception
throw ex; throw ex;
} catch (Exception ex) { } catch (Exception ex) {
throw new DocumentException("Can not read PDF content. File=" + leaf.getName() + ";" + ex.getMessage() ); throw new DocumentException("Can not read PDF content. File=" + leaf.getName(), ex);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment