SOLR-872 -- Better error message for incorrect copyField destination

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@718946 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shalin Shekhar Mangar 2008-11-19 12:53:29 +00:00
parent 8f14ef8475
commit dee0496714
2 changed files with 6 additions and 1 deletions

View File

@ -123,6 +123,8 @@ Bug Fixes
10. SOLR-869: Fix file descriptor leak in SolrResourceLoader#getLines (Mark Miller, shalin) 10. SOLR-869: Fix file descriptor leak in SolrResourceLoader#getLines (Mark Miller, shalin)
11. SOLR-872: Better error message for incorrect copyField destination (Noble Paul via shalin)
Other Changes Other Changes
---------------------- ----------------------

View File

@ -661,7 +661,10 @@ public final class IndexSchema {
boolean destIsPattern = isWildCard(dest); boolean destIsPattern = isWildCard(dest);
log.debug("copyField source='"+source+"' dest='"+dest+"'"); log.debug("copyField source='"+source+"' dest='"+dest+"'");
SchemaField d = getField(dest); SchemaField d = getFieldOrNull(dest);
if(d == null){
throw new SolrException( SolrException.ErrorCode.SERVER_ERROR, "copyField destination :'"+dest+"' does not exist" );
}
if(sourceIsPattern) { if(sourceIsPattern) {
if( destIsPattern ) { if( destIsPattern ) {