Wynntils

Wynntils

611k Downloads

`/wynntils update` NPE should have more user friendly message

san7890 opened this issue ยท 5 comments

commented

Try and run /wynntils update and the update will fail (currently on Fabric v0.0.3-alpha.383, while the most up-to-date version at the time of this issue report is v0.0.3-alpha.384):

[00:19:54] [ForkJoinPool.commonPool-worker-19/INFO]: Attempting to fetch Wynntils update.
[00:19:54] [ForkJoinPool.commonPool-worker-19/INFO]: Attempting to download update for stream alpha.
[00:19:57] [ForkJoinPool.commonPool-worker-19/WARN]: Failure in net manager [handleJsonObject], processing API:API_ATHENA_UPDATE_CHECK
java.lang.NullPointerException: Cannot invoke "com.google.gson.JsonPrimitive.getAsString()" because the return value of "com.google.gson.JsonObject.getAsJsonPrimitive(String)" is null
	at com.wynntils.services.athena.UpdateService.lambda$tryUpdate$2(UpdateService.java:86) ~[Wynntils.jar:?]
	at com.wynntils.core.net.NetResult.lambda$handleJsonObject$2(NetResult.java:57) ~[Wynntils.jar:?]
	at com.wynntils.core.net.NetResult.lambda$handleReader$1(NetResult.java:46) ~[Wynntils.jar:?]
	at com.wynntils.core.net.NetResult.lambda$wrappingHandler$5(NetResult.java:111) ~[Wynntils.jar:?]
	at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:718) ~[?:?]
	at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510) ~[?:?]
	at java.util.concurrent.CompletableFuture.postFire(CompletableFuture.java:614) ~[?:?]
	at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:844) ~[?:?]
	at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483) ~[?:?]
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[?:?]
	at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[?:?]
	at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[?:?]
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[?:?]
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[?:?]
[00:19:57] [ForkJoinPool.commonPool-worker-19/ERROR]: Exception while trying to load new update.

Expected behavior is to have the update apply rather than get the Error applying Wynntils/Artemis Update message. This exception throws when checking for a version mismatch when one connects to the Wynncraft servers as well, as evidented by this message that I also get in my log connecting to a server:

[00:19:49] [Render thread/INFO]: Couldn't fetch latest version, not attempting update reminder or auto-update.

A similar stack trace to the one already posted above precedes this.

commented

this isn't happening anymore, i'm not sure if you want to leave this issue report up so that someone can make it so that the user gets met with a better error about Athena failing

commented

Yeah, let's reinterpret this bug like that.

commented

Try now.

commented

Tried again just now, got this:

[12:53:20] [ForkJoinPool.commonPool-worker-19/INFO]: Attempting to fetch Wynntils update.
[12:53:20] [ForkJoinPool.commonPool-worker-19/INFO]: Attempting to download update for stream alpha.
[12:53:23] [ForkJoinPool.commonPool-worker-19/WARN]: Failure in net manager [handleJsonObject], processing API:API_ATHENA_UPDATE_CHECK
java.lang.NullPointerException: Cannot invoke "com.google.gson.JsonPrimitive.getAsString()" because the return value of "com.google.gson.JsonObject.getAsJsonPrimitive(String)" is null
	at com.wynntils.services.athena.UpdateService.lambda$tryUpdate$2(UpdateService.java:86) ~[Wynntils.jar:?]
	at com.wynntils.core.net.NetResult.lambda$handleJsonObject$2(NetResult.java:57) ~[Wynntils.jar:?]
	at com.wynntils.core.net.NetResult.lambda$handleReader$1(NetResult.java:46) ~[Wynntils.jar:?]
	at com.wynntils.core.net.NetResult.lambda$wrappingHandler$5(NetResult.java:111) ~[Wynntils.jar:?]
	at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:718) ~[?:?]
	at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510) ~[?:?]
	at java.util.concurrent.CompletableFuture.postFire(CompletableFuture.java:614) ~[?:?]
	at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:844) ~[?:?]
	at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483) ~[?:?]
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[?:?]
	at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[?:?]
	at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[?:?]
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[?:?]
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[?:?]
[12:53:23] [ForkJoinPool.commonPool-worker-19/ERROR]: Exception while trying to load new update.
commented

I believe this is a failure in Athena, but we could probably handle the exception and present a reasonable error message to the user ("Update service currently unavailable").