mirror of
https://github.com/servo/servo.git
synced 2025-09-18 19:08:22 +01:00
net: use log::error!
to handle DevTools startup failures gracefully (#39320)
Replace the `unwrap()` call with `log::error!()` in the `send_request_to_devtools()` function to enhance error handling. --- Before: ``` ╰─❯ ./servo --devtools=1 [2025-09-15T14:35:07Z ERROR servoshell::desktop::app_state] Saw Servo error: DevtoolsFailedToStart! called `Result::unwrap()` on an `Err` value: "SendError(..)" (thread tokio-runtime-5, at components/net/http_loader.rs:435) [2025-09-15T14:35:07Z ERROR servoshell::panic_hook] called `Result::unwrap()` on an `Err` value: "SendError(..)" ``` After: ``` ╰─❯ ./servo --devtools=1 [2025-09-16T01:24:59Z ERROR servoshell::desktop::app_state] Saw Servo error: DevtoolsFailedToStart! [2025-09-16T01:24:59Z ERROR net::http_loader] DevTools send failed: sending on a disconnected channel [2025-09-16T01:24:59Z ERROR net::http_loader] DevTools send failed: sending on a disconnected channel ... ``` Signed-off-by: Integral <integral@member.fsf.org>
This commit is contained in:
parent
22dcc8a49d
commit
2b261b02bf
1 changed files with 3 additions and 3 deletions
|
@ -430,9 +430,9 @@ pub fn send_request_to_devtools(
|
|||
msg: ChromeToDevtoolsControlMsg,
|
||||
devtools_chan: &Sender<DevtoolsControlMsg>,
|
||||
) {
|
||||
devtools_chan
|
||||
.send(DevtoolsControlMsg::FromChrome(msg))
|
||||
.unwrap();
|
||||
if let Err(e) = devtools_chan.send(DevtoolsControlMsg::FromChrome(msg)) {
|
||||
error!("DevTools send failed: {e}");
|
||||
}
|
||||
}
|
||||
|
||||
pub fn send_response_to_devtools(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue