mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
devtools: handle script task panics gracefully in ConsoleActor.
This commit is contained in:
parent
92a8c7a80c
commit
b328c57caa
6 changed files with 44 additions and 31 deletions
|
@ -118,8 +118,8 @@ impl Actor for ConsoleActor {
|
|||
_registry: &ActorRegistry,
|
||||
msg_type: &String,
|
||||
msg: &json::JsonObject,
|
||||
stream: &mut TcpStream) -> bool {
|
||||
match msg_type.as_slice() {
|
||||
stream: &mut TcpStream) -> Result<bool, ()> {
|
||||
Ok(match msg_type.as_slice() {
|
||||
"getCachedMessages" => {
|
||||
let types = msg.get(&"messageTypes".to_string()).unwrap().as_list().unwrap();
|
||||
let /*mut*/ messages = vec!();
|
||||
|
@ -223,7 +223,7 @@ impl Actor for ConsoleActor {
|
|||
self.script_chan.send(EvaluateJS(self.pipeline, input.clone(), chan));
|
||||
|
||||
//TODO: extract conversion into protocol module or some other useful place
|
||||
let result = match port.recv() {
|
||||
let result = match try!(port.recv_opt()) {
|
||||
VoidValue => {
|
||||
let mut m = TreeMap::new();
|
||||
m.insert("type".to_string(), "undefined".to_string().to_json());
|
||||
|
@ -285,6 +285,6 @@ impl Actor for ConsoleActor {
|
|||
}
|
||||
|
||||
_ => false
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue