Skip to content

Error msg so obscure when connect url port miss #768

Open
@camilesing

Description

@camilesing

Hi, the problem takes me some time:
when I init InfluxDB instance from InfluxDBFactory.connect, I miss a port, like:

InfluxDBFactory.connect("127.0.0.1", "username", "password");

actually, the code should be

InfluxDBFactory.connect("127.0.0.1:8086", "username", "password");

but I didn't notice it. then I query a table, the program throw exception and show stack trace:

Exception in thread "main" org.influxdb.InfluxDBException: 
	at org.influxdb.InfluxDBException.buildExceptionForErrorState(InfluxDBException.java:175)
	at org.influxdb.impl.InfluxDBImpl.execute(InfluxDBImpl.java:837)
	at org.influxdb.impl.InfluxDBImpl.executeQuery(InfluxDBImpl.java:824)
	at org.influxdb.impl.InfluxDBImpl.query(InfluxDBImpl.java:559)

I think its so obscure, the exception can throw early. For example, when init InfluxDB instance, it can throw IllegalArugemntException: The port cannot be null

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions