You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@metamodel.apache.org by "Kasper Sørensen (JIRA)" <ji...@apache.org> on 2015/01/23 13:43:35 UTC

[jira] [Created] (METAMODEL-106) ElasticSearchDataContext throws NPE when index is not found

Kasper Sørensen created METAMODEL-106:
-----------------------------------------

             Summary: ElasticSearchDataContext throws NPE when index is not found
                 Key: METAMODEL-106
                 URL: https://issues.apache.org/jira/browse/METAMODEL-106
             Project: Apache MetaModel
          Issue Type: Bug
    Affects Versions: 4.3.0-incubating
            Reporter: Kasper Sørensen


If I accidentally use a wrong index name when creating an ElasticSearchDataContext, I get an exception like this:

{code}
java.lang.NullPointerException
	at org.apache.metamodel.elasticsearch.ElasticSearchDataContext.detectSchema(ElasticSearchDataContext.java:161)
	at org.apache.metamodel.elasticsearch.ElasticSearchDataContext.<init>(ElasticSearchDataContext.java:122)
{code}

I would expect a more meaningful exception - either IllegalArgumentException or a MetaModelException - with a proper explanation as a message.

We should also have sensible checks for null values and empty strings etc.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)