Skip to content

InfluxDBException: 'error parsing query' - Error is not propagated to Consumer callback #498

Description

@anastasiaO

Hello,

please take a look at InfluxDBImpl.java#L548

If you throw an InfluxDBException an this position, it is not possible to catch it on the caller side:

public void loadDataAsync(int chunk, Consumer<QueryResult> consumer) {
    // Bad syntax test
    db.query(new Query("SELECT * FROM sieries LIMIT -100", databaseName), chunk, consumer);
}

Stacktrace:

org.influxdb.InfluxDBException: {"error":"error parsing query: found -, expected integer at line 1, char 63"}

at org.influxdb.impl.InfluxDBImpl$1.onResponse(InfluxDBImpl.java:420)
at retrofit2.OkHttpCall$1.callSuccess(OkHttpCall.java:138)
at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:117)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:141)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)

This causes my REST-Endpoint (Spring MVC) to hang.
image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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