[PATCH] AnyEvent::Handle

Marc Lehmann schmorp at schmorp.de
Tue Jul 3 11:02:00 CEST 2012

On Tue, Jul 03, 2012 at 10:55:56AM +0200, Maxime Soulé <btik-cpan at scoubidou.com> wrote:
> If an exception is thrown by the callback, it will be trapped and
> assimilated to a "Bad Message", which is wrong...

hmm why?

> I think that exceptions thrown by the callback should not be caught
> at this level.

It doesn't matter, as callbacks must not throw exceptions without catching
them themselves. If they do, they are already buggy and invoke undefined
behaviour - causing EBADMSG is then the least of the problems.

In fact, if caught via this mechanism it at least has a chance of getting
reported in a defined way (although it's still a bug).

                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      schmorp at schmorp.de
      -=====/_/_//_/\_,_/ /_/\_\

More information about the anyevent mailing list