Catch exceptions in node message handlers.

This commit is contained in:
Tony Garnock-Jones 2012-01-08 14:02:52 -05:00
parent cecd0486eb
commit 965a9752e0
1 changed files with 7 additions and 1 deletions

View File

@ -54,7 +54,13 @@ let unbind_all n =
let send name body =
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
let post name label body token =