diff --git a/components/devtools/actors/root.rs b/components/devtools/actors/root.rs index d6a4f2e4edd42..a252255f52e9d 100644 --- a/components/devtools/actors/root.rs +++ b/components/devtools/actors/root.rs @@ -115,6 +115,13 @@ struct GetProcessResponse { process_descriptor: ProcessActorMsg, } +#[derive(Serialize)] +struct ErrorResponse { + from: String, + error: String, + message: String, +} + pub struct RootActor { pub tabs: Vec, pub workers: Vec, @@ -249,7 +256,19 @@ impl Actor for RootActor { ActorMessageStatus::Processed }, - _ => ActorMessageStatus::Ignored, + _ => { + let reply = ErrorResponse { + from: self.name(), + error: "unrecognizedPacketType".to_owned(), + message: format!( + "Actor {} does not recognize the packet type '{}'", + self.name(), + msg_type, + ), + }; + let _ = stream.write_json_packet(&reply); + ActorMessageStatus::Ignored + }, }) } }