diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 26f49d37225..33e3a17188a 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -129,6 +129,7 @@ Bug Fixes later when a filter of the same term was specified. (Günter Hipler, hossman, yonik) +* SOLR-3679: Core Admin UI gives no feedback if "Add Core" fails (steffkes, hossman) Other Changes ---------------------- diff --git a/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java b/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java index e85997b5444..1c299a1e301 100644 --- a/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java @@ -442,9 +442,13 @@ public class CoreAdminHandler extends RequestHandlerBase { * @throws SolrException in case of a configuration error. */ protected boolean handleCreateAction(SolrQueryRequest req, SolrQueryResponse rsp) throws SolrException { + SolrParams params = req.getParams(); + String name = params.get(CoreAdminParams.NAME); + if (null == name || "".equals(name)) { + throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, + "Core name is mandatory to CREATE a SolrCore"); + } try { - SolrParams params = req.getParams(); - String name = params.get(CoreAdminParams.NAME); //for now, do not allow creating new core with same name when in cloud mode //XXX perhaps it should just be unregistered from cloud before readding it?, @@ -518,7 +522,8 @@ public class CoreAdminHandler extends RequestHandlerBase { return coreContainer.isPersistent(); } catch (Exception ex) { throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, - "Error executing default implementation of CREATE", ex); + "Error CREATEing SolrCore '" + name + "': " + + ex.getMessage(), ex); } } diff --git a/solr/webapp/web/css/styles/cores.css b/solr/webapp/web/css/styles/cores.css index c60f25d0e38..2481105f83d 100644 --- a/solr/webapp/web/css/styles/cores.css +++ b/solr/webapp/web/css/styles/cores.css @@ -46,6 +46,12 @@ display: none; } +#content #cores .actions form .error +{ + color: #800; + display: none; +} + #content #cores .actions form p { padding-bottom: 8px; @@ -62,7 +68,8 @@ #content #cores .actions form input, #content #cores .actions form select, -#content #cores .actions form .buttons +#content #cores .actions form .buttons, +#content #cores .actions form .error span { float: right; width: 73%; diff --git a/solr/webapp/web/js/scripts/cores.js b/solr/webapp/web/js/scripts/cores.js index 05f21b1f71b..cf5cf1c5d96 100644 --- a/solr/webapp/web/js/scripts/cores.js +++ b/solr/webapp/web/js/scripts/cores.js @@ -365,6 +365,12 @@ sammy.get }, error : function( xhr, text_status, error_thrown ) { + var response = null; + eval( 'response = ' + xhr.responseText + ';' ); + + var error_elem = $( '.error', div_action.filter( ':visible' ) ); + error_elem.show(); + $( 'span', error_elem ).text( response.error.msg ); }, complete : function() { diff --git a/solr/webapp/web/tpl/cores.html b/solr/webapp/web/tpl/cores.html index cf6e1f3472a..fba06b60d0e 100644 --- a/solr/webapp/web/tpl/cores.html +++ b/solr/webapp/web/tpl/cores.html @@ -36,19 +36,19 @@ limitations under the License.
-
+-
+-
+-
+-
++ + + +
+