Print WebSocket errors when we get them (#2018)
* Print WebSocket errors when we get them Previously, we eat them and ignore them, but now we'll seek out and actively print error messages to stderr. We'd previously get a websocket closed error, but we'll usually get an Error message over the WebSocket before its closed on us. Here's some example output during a crash ``` got ws error: WebSocket protocol error: Connection reset without closing handshake Caused by: Connection reset without closing handshake thread 'serial_test_cube_mm' panicked at tests/executor/main.rs:1136:10: called `Result::unwrap()` on an `Err` value: engine: KclErrorDetails { source_ranges: [SourceRange([180, 188])], message: "Modeling command failed: websocket closed early" } test serial_test_cube_mm ... FAILED got error message: { "error_code": "bad_request", "message": "Too many active connections, only 2 allowed per user." } ```
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 50 KiB |
@ -135,6 +135,9 @@ impl EngineConnection {
|
||||
loop {
|
||||
match tcp_read.read().await {
|
||||
Ok(ws_resp) => {
|
||||
for e in ws_resp.errors.iter().flatten() {
|
||||
println!("got error message: {e}");
|
||||
}
|
||||
if let Some(id) = ws_resp.request_id {
|
||||
responses_clone.insert(id, ws_resp.clone());
|
||||
}
|
||||
|