mirror of
https://github.com/servo/servo.git
synced 2025-08-11 16:35:33 +01:00
devtools: Warn when sending common protocol errors (#38548)
#37686 fixed an entire class of devtools protocol bugs that led to protocol desyncs with warnings in the Servo log, but it also removed the warnings, making it harder to spot where our devtools impl is incomplete. this patch reintroduces a warning whenever some Actor::handle_message() returns Err(ActorError). Testing: debug logging only, so not really worth testing --------- Signed-off-by: Delan Azabani <dazabani@igalia.com> Co-authored-by: atbrakhi <atbrakhi@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
4257db643b
commit
9866ca7e59
1 changed files with 5 additions and 3 deletions
|
@ -11,7 +11,7 @@ use std::sync::{Arc, Mutex};
|
|||
|
||||
use base::cross_process_instant::CrossProcessInstant;
|
||||
use base::id::PipelineId;
|
||||
use log::debug;
|
||||
use log::{debug, warn};
|
||||
use serde_json::{Map, Value, json};
|
||||
|
||||
use crate::StreamId;
|
||||
|
@ -223,9 +223,11 @@ impl ActorRegistry {
|
|||
actor.handle_message(req, self, msg_type, msg, stream_id)
|
||||
}) {
|
||||
// <https://firefox-source-docs.mozilla.org/devtools/backend/protocol.html#error-packets>
|
||||
let _ = stream.write_json_packet(&json!({
|
||||
let error = json!({
|
||||
"from": actor.name(), "error": error.name()
|
||||
}));
|
||||
});
|
||||
warn!("Sending devtools protocol error: error={error:?} request={msg:?}");
|
||||
let _ = stream.write_json_packet(&error);
|
||||
}
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue