Skip to content

Commit

Permalink
fix: GameSDKException did not assign result variable (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanzhoudev authored Jul 13, 2023
1 parent 8baf489 commit cd4d546
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
* Exception which is thrown when a {@link Result} that is not {@link Result#OK} occurs.
*/
public class GameSDKException extends RuntimeException {
private Result result;
private final Result result;

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

/**
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/com/wynntils/antiope/test.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import com.wynntils.antiope.core.DiscordGameSDKCore;
import com.wynntils.antiope.core.type.CreateParams;
import com.wynntils.antiope.core.type.GameSDKException;
import com.wynntils.antiope.manager.activity.type.Activity;

import java.time.Instant;
Expand All @@ -20,7 +21,9 @@ public static void main(String[] args) {
try {
core = new DiscordGameSDKCore(params);
System.out.println("got new core");
} catch (RuntimeException e) {
} catch (GameSDKException e) {
e.printStackTrace();
System.out.println(e.getResult());
System.out.println("discord is not running, exiting");
return;
}
Expand Down

0 comments on commit cd4d546

Please sign in to comment.