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

NullPointerException when using invalid credentials #18

Open
cdietze opened this issue Feb 24, 2020 · 1 comment
Open

NullPointerException when using invalid credentials #18

cdietze opened this issue Feb 24, 2020 · 1 comment

Comments

@cdietze
Copy link

cdietze commented Feb 24, 2020

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)
@AlexFalappa
Copy link

Just lost an hour facing this with a wrong password (cause upon application creation the web sites says the application password is equal to my email address, while it is actually sent to my e-mail address).

The API should definitely throw a meaningful exception or return an appropriate error response.

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