Skip to content

NullPointerException when using invalid credentials #18

@cdietze

Description

@cdietze

I tried a business card request using an invalid applicationId. This produced the NullPointerException you see below.
Using the debugger, I see the server rightfully responded with a 401.
I think the API should handle cases like this more graceful. Also supplying Details about the error such as the response code would be useful.
I used version 1.0.0.

Caused by: java.lang.NullPointerException
	at java.io.Reader.<init>(Reader.java:78)
	at java.io.InputStreamReader.<init>(InputStreamReader.java:72)
	at com.ocrsdk.abbyy.v2.client.http.HttpAsyncResponse.buildResponse(HttpAsyncResponse.java:63)
	at com.ocrsdk.abbyy.v2.client.http.HttpAsyncClient.lambda$sendRequest$0(HttpAsyncClient.java:61)
	at java.util.concurrent.CompletableFuture$AsyncSupply.run$$$capture(CompletableFuture.java:1590)
	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java)
	at java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1582)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

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