Skip to content

no value for read throws IllegalArgumentException #28

@jack-kerouac

Description

@jack-kerouac

When trying to read a non-existing value from a time series (whether the series is empty, or trying to read a value before the first one in the series or after the last one), the following exception is thrown:

Exception in thread "main" java.lang.IllegalArgumentException: Unknown class: class com.tempodb.SingleValue
    at com.tempodb.Result.newInstanceFromResponse(Result.java:160)
    at com.tempodb.Result.<init>(Result.java:78)
    at com.tempodb.Client.execute(Client.java:1208)
    at com.tempodb.Client.readSingleValue(Client.java:472)
    at com.tempodb.Client.readSingleValue(Client.java:401)
    at com.tempodb.Client$readSingleValue.call(Unknown Source)
    at com.tado.tsds.tempodb.TempoDbMain.main(TempoDbMain.groovy:112)
Caused by: java.lang.reflect.InvocationTargetException
    at com.tempodb.Result.newInstanceFromResponse(Result.java:153)
    ... 25 more
Caused by: java.lang.NullPointerException
    at com.tempodb.util.Preconditions.checkNotNull(Preconditions.java:27)
    at com.tempodb.SingleValue.<init>(SingleValue.java:43)
    at com.tempodb.json.SingleValueModule$SingleValueDeserializer.deserialize(SingleValueModule.java:65)
    at com.tempodb.json.SingleValueModule$SingleValueDeserializer.deserialize(SingleValueModule.java:30)
    at com.fasterxml.jackson.databind.ObjectReader._bindAndClose(ObjectReader.java:1216)
    at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:830)
    at com.tempodb.json.Json.loads(Json.java:46)
    at com.tempodb.SingleValue.make(SingleValue.java:78)
    ... 30 more

I believe that the result should signal that instead of this strange exception.

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