Catch exceptions in node message handlers.
This commit is contained in:
parent
cecd0486eb
commit
965a9752e0
8
node.ml
8
node.ml
|
@ -54,7 +54,13 @@ let unbind_all n =
|
||||||
|
|
||||||
let send name body =
|
let send name body =
|
||||||
match lookup name with
|
match lookup name with
|
||||||
| Some n -> n.handle_message n body; true
|
| Some n ->
|
||||||
|
(try n.handle_message n body
|
||||||
|
with e ->
|
||||||
|
printf "WARNING: Node <<%s>> message handler raised %s\n%!"
|
||||||
|
name
|
||||||
|
(Printexc.to_string e));
|
||||||
|
true
|
||||||
| None -> false
|
| None -> false
|
||||||
|
|
||||||
let post name label body token =
|
let post name label body token =
|
||||||
|
|
Loading…
Reference in New Issue