metamodel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kasper Sørensen (JIRA) <j...@apache.org>
Subject [jira] [Created] (METAMODEL-106) ElasticSearchDataContext throws NPE when index is not found
Date Fri, 23 Jan 2015 12:43:35 GMT
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)

Mime
View raw message