Author: echatellier Date: 2013-02-05 18:23:48 +0100 (Tue, 05 Feb 2013) New Revision: 76 Url: http://forge.codelutin.com/projects/cantharella/repository/revisions/76 Log: Remove e.printStackTrace() Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/exceptions/UnexpectedException.java trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/SearchServiceImpl.java Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/exceptions/UnexpectedException.java =================================================================== --- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/exceptions/UnexpectedException.java 2013-02-05 17:19:14 UTC (rev 75) +++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/exceptions/UnexpectedException.java 2013-02-05 17:23:48 UTC (rev 76) @@ -36,5 +36,14 @@ public UnexpectedException(Exception cause) { super(cause.getMessage(), cause); } + + /** + * Constructor + * @param message Message + * @param cause Cause + */ + public UnexpectedException(String message, Exception cause) { + super(message, cause); + } } Modified: trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/SearchServiceImpl.java =================================================================== --- trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/SearchServiceImpl.java 2013-02-05 17:19:14 UTC (rev 75) +++ trunk/cantharella.service/src/main/java/nc/ird/cantharella/service/services/impl/SearchServiceImpl.java 2013-02-05 17:23:48 UTC (rev 76) @@ -26,6 +26,7 @@ import javax.annotation.Resource; +import nc.ird.cantharella.data.exceptions.UnexpectedException; import nc.ird.cantharella.data.model.Extraction; import nc.ird.cantharella.data.model.Lot; import nc.ird.cantharella.data.model.Molecule; @@ -37,8 +38,6 @@ import nc.ird.cantharella.service.model.SearchResult; import nc.ird.cantharella.service.services.SearchService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.apache.lucene.index.FieldInfos; import org.apache.lucene.index.IndexReader; import org.apache.lucene.queryParser.MultiFieldQueryParser; @@ -56,6 +55,8 @@ import org.hibernate.search.MassIndexer; import org.hibernate.search.Search; import org.hibernate.search.SearchFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; /** @@ -92,9 +93,8 @@ long after = System.currentTimeMillis(); LOG.info("Lucene index rebuilded in " + (after-before) + " ms"); } - } catch (InterruptedException e) { - LOG.error(e.toString()); - e.printStackTrace(); + } catch (InterruptedException ex) { + throw new UnexpectedException("Can't rebuild index", ex); } } @@ -143,8 +143,8 @@ result.setStations(resultatStations); result.setMolecules(resultatMolecules); - } catch (ParseException e) { - e.printStackTrace(); + } catch (ParseException ex) { + throw new UnexpectedException("Can't parse query", ex); } //tx.commit();
participants (1)
-
echatellier@users.forge.codelutin.com