diff options
author | hannibal2 <24389977+hannibal002@users.noreply.github.com> | 2023-02-15 18:48:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-15 18:48:11 +0100 |
commit | 5c58e19436f2935ae20cfb351ac6661b2dab1992 (patch) | |
tree | 160d6549a0a71bd2dec16a39d9b1feca1ff6be6d /src/main/java | |
parent | cd219f19da268c5697081c092d35c9b1f5198058 (diff) | |
download | NotEnoughUpdates-5c58e19436f2935ae20cfb351ac6661b2dab1992.tar.gz NotEnoughUpdates-5c58e19436f2935ae20cfb351ac6661b2dab1992.tar.bz2 NotEnoughUpdates-5c58e19436f2935ae20cfb351ac6661b2dab1992.zip |
API errors in console (#610)
* Print api errors in console.
* No reason not to just append.
* Censor API Key
---------
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Co-authored-by: nea <nea@nea.moe>
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/core/config/annotations/ConfigOption.java | 1 | ||||
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/util/ApiUtil.java | 7 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/core/config/annotations/ConfigOption.java b/src/main/java/io/github/moulberry/notenoughupdates/core/config/annotations/ConfigOption.java index 920cb326..ddd1e71f 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/core/config/annotations/ConfigOption.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/core/config/annotations/ConfigOption.java @@ -30,6 +30,7 @@ public @interface ConfigOption { String name(); String desc(); + String[] searchTags() default ""; int subcategoryId() default -1; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/ApiUtil.java b/src/main/java/io/github/moulberry/notenoughupdates/util/ApiUtil.java index 023be060..45522329 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/ApiUtil.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/ApiUtil.java @@ -213,7 +213,12 @@ public class ApiUtil { } catch (IOException e) { throw new RuntimeException(e); // We can rethrow, since supplyAsync catches exceptions. } - }, executorService); + }, executorService).handle((obj, t) -> { + if (t != null) { + System.err.println(ErrorUtil.printStackTraceWithoutApiKey(t)); + } + return obj; + }); } public CompletableFuture<JsonObject> requestJson() { |