Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-268 - Tweaks to post.jar so it prints the error message from Solr.

Chris M. Hostetter9eb7ff4bc5a7
diff --git a/CHANGES.txt b/CHANGES.txt
index 4a042c147ba..caedd6cf07b 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -92,7 +92,9 @@ Other Changes
to be removed in a later release. While this change does not affect API
compatibility, it is recommended to update references to these
deprecated classes. (ryan)
-
+
+ 2. SOLR-268: Tweaks to post.jar so it prints the error message from Solr.
+ (Brian Whitman via hossman)
================== Release 1.2, 20070602 ==================
diff --git a/src/java/org/apache/solr/util/SimplePostTool.java b/src/java/org/apache/solr/util/SimplePostTool.java
index 5e545a97c6b..ed71cd6ec92 100644
--- a/src/java/org/apache/solr/util/SimplePostTool.java
+++ b/src/java/org/apache/solr/util/SimplePostTool.java
@@ -264,8 +264,10 @@ public class SimplePostTool {
}
} catch (IOException e) {
+ try {
+ fatal("Solr returned an error: " + urlc.getResponseMessage());
+ } catch (IOException f) { }
fatal("Connection error (is Solr running at " + solrUrl + " ?): " + e);
-
} finally {
if(urlc!=null) urlc.disconnect();
}