More debugging

This commit is contained in:
Baud 2024-06-01 16:01:20 +01:00
parent 7eb7f9fa31
commit 2c1fc09576
2 changed files with 17 additions and 4 deletions

View File

@ -91,7 +91,11 @@ function handle_message(message: Partial<WebSocketMessage>) {
status: transportInfo.status,
})
}).catch((err) => {
console.log(err)
console.log(JSON.stringify(err))
notifyClients({
event: "log",
message: JSON.stringify(err)
})
})
}, 1000)
@ -107,7 +111,11 @@ function handle_message(message: Partial<WebSocketMessage>) {
remaining: slot.recordingTime
})
}).catch((err) => {
console.log(err)
console.log(JSON.stringify(err))
notifyClients({
event: "log",
message: JSON.stringify(err)
})
})
}, 1000)
}
@ -132,6 +140,10 @@ function handle_message(message: Partial<WebSocketMessage>) {
})
newHyperdeck.on('error', (err) => {
console.log('Hyperdeck error', JSON.stringify(err))
notifyClients({
event: "log",
message: JSON.stringify(err)
})
})
newHyperdeck.on('disconnected', () => {

View File

@ -102,6 +102,7 @@ async fn handle_message_from_node(
_node_commands_tx: &mut tokio::sync::mpsc::UnboundedSender<NodeWsCommand>,
state: &mut HyperdeckMonitorState,
) -> bool {
tracing::info!("{:?}", msg);
match msg {
NodeWsMessageReceived::Log { message } => {
tracing::info!("[NODE] {message}");
@ -253,7 +254,7 @@ enum NodeWsCommand {
RemoveHyperdeck(RemoveHyperdeckCommand),
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
#[serde(tag = "event")]
enum NodeWsMessageReceived {
@ -277,7 +278,7 @@ enum NodeWsMessageReceived {
},
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
enum TransportStatus {
Preview,