mirror of https://github.com/apache/lucene.git
SOLR-7934: SolrCLI masks underlying cause of create collection failure.
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1696056 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
16f3f8e1b5
commit
2443a7e6c1
|
@ -390,6 +390,8 @@ Bug Fixes
|
||||||
* SOLR-7921: The techproducts example fails when running in a directory that contains spaces.
|
* SOLR-7921: The techproducts example fails when running in a directory that contains spaces.
|
||||||
(Ishan Chattopadhyaya via Timothy Potter)
|
(Ishan Chattopadhyaya via Timothy Potter)
|
||||||
|
|
||||||
|
* SOLR-7934: SolrCLI masks underlying cause of create collection failure. (Timothy Potter)
|
||||||
|
|
||||||
|
|
||||||
Optimizations
|
Optimizations
|
||||||
----------------------
|
----------------------
|
||||||
|
|
|
@ -1446,13 +1446,7 @@ public class SolrCLI {
|
||||||
try {
|
try {
|
||||||
json = getJson(createCollectionUrl);
|
json = getJson(createCollectionUrl);
|
||||||
} catch (SolrServerException sse) {
|
} catch (SolrServerException sse) {
|
||||||
// check if already exists
|
throw new Exception("Failed to create collection '"+collectionName+"' due to: "+sse.getMessage());
|
||||||
if (safeCheckCollectionExists(collectionListUrl, collectionName)) {
|
|
||||||
throw new IllegalArgumentException("Collection '"+collectionName+
|
|
||||||
"' already exists!\nChecked collection existence using Collections API command:\n"+collectionListUrl);
|
|
||||||
} else {
|
|
||||||
throw new Exception("Failed to create collection '"+collectionName+"' due to: "+sse.getMessage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CharArr arr = new CharArr();
|
CharArr arr = new CharArr();
|
||||||
|
@ -1584,18 +1578,7 @@ public class SolrCLI {
|
||||||
|
|
||||||
echo("\nCreating new core '" + coreName + "' using command:\n" + createCoreUrl + "\n");
|
echo("\nCreating new core '" + coreName + "' using command:\n" + createCoreUrl + "\n");
|
||||||
|
|
||||||
Map<String,Object> json = null;
|
Map<String,Object> json = getJson(createCoreUrl);
|
||||||
try {
|
|
||||||
json = getJson(createCoreUrl);
|
|
||||||
} catch (SolrServerException sse) {
|
|
||||||
// mostly likely the core already exists ...
|
|
||||||
if (safeCheckCoreExists(coreStatusUrl, coreName)) {
|
|
||||||
// core already exists
|
|
||||||
throw new IllegalArgumentException("Core '"+coreName+"' already exists!\nChecked core existence using Core API command:\n"+coreStatusUrl);
|
|
||||||
} else {
|
|
||||||
throw sse;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CharArr arr = new CharArr();
|
CharArr arr = new CharArr();
|
||||||
new JSONWriter(arr, 2).write(json);
|
new JSONWriter(arr, 2).write(json);
|
||||||
|
|
Loading…
Reference in New Issue