Skip to content

Commit cd4d546

Browse files
authored
fix: GameSDKException did not assign result variable (#15)
1 parent 8baf489 commit cd4d546

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/main/java/com/wynntils/antiope/core/type/GameSDKException.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
* Exception which is thrown when a {@link Result} that is not {@link Result#OK} occurs.
55
*/
66
public class GameSDKException extends RuntimeException {
7-
private Result result;
7+
private final Result result;
88

99
public GameSDKException(Result result) {
1010
super("Game SDK operation failed: " + result);
11+
this.result = result;
1112
}
1213

1314
/**

src/main/java/com/wynntils/antiope/test.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import com.wynntils.antiope.core.DiscordGameSDKCore;
55
import com.wynntils.antiope.core.type.CreateParams;
6+
import com.wynntils.antiope.core.type.GameSDKException;
67
import com.wynntils.antiope.manager.activity.type.Activity;
78

89
import java.time.Instant;
@@ -20,7 +21,9 @@ public static void main(String[] args) {
2021
try {
2122
core = new DiscordGameSDKCore(params);
2223
System.out.println("got new core");
23-
} catch (RuntimeException e) {
24+
} catch (GameSDKException e) {
25+
e.printStackTrace();
26+
System.out.println(e.getResult());
2427
System.out.println("discord is not running, exiting");
2528
return;
2629
}

0 commit comments

Comments
 (0)