Skip to content

Commit cfa54c8

Browse files
author
eberhardtj
committed
Refactor error handling.
1 parent b007328 commit cfa54c8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main/java/org/metafacture/solr/SolrCommitProcess.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,14 @@ private boolean commit(List<SolrInputDocument> documents) {
8585
if (response.getStatus() != 0) {
8686
return false;
8787
}
88+
} catch (IOException e) {
89+
System.err.println("Could not commit batch, due to communication error: " + e.getMessage());
90+
return false;
91+
} catch (SolrServerException e) {
92+
System.err.println("Could not commit batch, due to server error: " + e.getMessage());
93+
return false;
8894
} catch (Exception e) {
89-
System.err.println("Could not commit batch, due to " + e.getMessage());
95+
System.err.println("Could not commit batch, due to unknown error: " + e.getMessage());
9096
return false;
9197
}
9298
return true;

0 commit comments

Comments
 (0)