Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error msg so obscure when connect url port miss #768

Open
camilesing opened this issue Sep 9, 2021 · 2 comments
Open

Error msg so obscure when connect url port miss #768

camilesing opened this issue Sep 9, 2021 · 2 comments

Comments

@camilesing
Copy link

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

@majst01
Copy link
Collaborator

majst01 commented Sep 9, 2021

good point, are you willing to write a fix in a pull request ?

@camilesing
Copy link
Author

@majst01 yes, I pleasure contribute to the open-source community

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants