Skip to content

Commit e183aa8

Browse files
Add AuthTokenGenerationException
1 parent 2ca9d43 commit e183aa8

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.gravitylab.obscontrollerapi.utils;
2+
3+
public class AuthTokenGenerationException extends RuntimeException {
4+
public AuthTokenGenerationException(String message, Throwable cause) {
5+
super(message, cause);
6+
}
7+
}

src/main/java/com/gravitylab/obscontrollerapi/websocket/OBSWebSocketClient.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
import org.java_websocket.handshake.ServerHandshake;
1212
import org.json.JSONObject;
1313

14+
import com.gravitylab.obscontrollerapi.utils.AuthTokenGenerationException;
15+
1416
import lombok.extern.slf4j.Slf4j;
1517

1618
@Slf4j
@@ -122,7 +124,7 @@ private String generateAuthToken(String salt, String challenge) {
122124
try {
123125
return generateSecret(salt, challenge);
124126
} catch (NoSuchAlgorithmException e) {
125-
throw new RuntimeException(e);
127+
throw new AuthTokenGenerationException("Failed to generate auth token", e);
126128
}
127129
}
128130

0 commit comments

Comments
 (0)