Skip to content

Commit

Permalink
Fixed blank error messages over RPC from websocket commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Xemdo committed May 24, 2023
1 parent cbd1b14 commit 7c44046
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions internal/events/websocket/mock_server/rpc_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ func RPCReconnectHandler(args rpc.RPCArgs) rpc.RPCResponse {
log.Printf("Initiating reconnect testing...")

if serverManager.reconnectTesting {
log.Printf("Error on RPC call (EventSubWebSocketReconnect): Cannot execute reconnect testing while its already in progress. Aborting.")
log.Printf("Error on RPC call (EventSubWebSocketReconnect): Cannot execute reconnect testing while its already in progress. Discarding duplicate reconnect command.")
return rpc.RPCResponse{
ResponseCode: COMMAND_RESPONSE_FAILED_ON_SERVER,
DetailedInfo: "Error on RPC call (EventSubWebSocketReconnect): Cannot execute reconnect testing while its already in progress. Discarding duplicate reconnect command.",
}
}

Expand All @@ -51,6 +52,7 @@ func RPCReconnectHandler(args rpc.RPCArgs) rpc.RPCResponse {
log.Printf("Error on RPC call (EventSubWebSocketReconnect): Primary server not in server list.")
return rpc.RPCResponse{
ResponseCode: COMMAND_RESPONSE_FAILED_ON_SERVER,
DetailedInfo: "Error on RPC call (EventSubWebSocketReconnect): Primary server not in server list.",
}
}

Expand Down Expand Up @@ -111,6 +113,7 @@ func RPCFireEventSubHandler(args rpc.RPCArgs) rpc.RPCResponse {
log.Printf("Error on RPC call (EventSubWebSocketForwardEvent): Primary server not in server list.")
return rpc.RPCResponse{
ResponseCode: COMMAND_RESPONSE_FAILED_ON_SERVER,
DetailedInfo: "Primary server not in server list.",
}
}

Expand Down Expand Up @@ -234,7 +237,7 @@ func RPCSubscriptionHandler(args rpc.RPCArgs) rpc.RPCResponse {
log.Printf("Error on RPC call (EventSubWebSocketSubscription): Primary server not in server list.")
return rpc.RPCResponse{
ResponseCode: COMMAND_RESPONSE_FAILED_ON_SERVER,
DetailedInfo: "See server console for more details.",
DetailedInfo: "Primary server not in server list.",
}
}

Expand Down
2 changes: 1 addition & 1 deletion internal/events/websocket/websocket_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func ForwardWebsocketCommand(cmd string, p WebsocketCommandParameters) error {

switch reply.ResponseCode {
case mock_server.COMMAND_RESPONSE_SUCCESS:
color.New().Add(color.FgGreen).Println(fmt.Sprintf("✔ Forwarded for use in mock EventSub WebSocket server"))
color.New().Add(color.FgGreen).Println(fmt.Sprintf("✔ Forwarded for use in mock EventSub WebSocket server\n"))
return nil

case mock_server.COMMAND_RESPONSE_FAILED_ON_SERVER:
Expand Down

0 comments on commit 7c44046

Please sign in to comment.