Am 06.10.2016 um 21:07 schrieb Brandon Allbery via RT: > Actually, now that I think about it, there is something that can be done; > not ideal, but the best we could do under the circumstances. Callbacks > should be given default exception handlers that at minimum output the > original exception (which currently is being lost when finding the > exception handler fails) and say they're aborting because there's no way to > pass the exception back through C to the outer Perl scope. Something like: > > Exception in Perl callback cannot be passed back through native code. > All we can do is die. Sorry. > Unhandled exception: > (actual thrown exception here)
Actually that's the only sane way to deal with such a situation, and that should be documented behaviour for callbacks. Essentially, it's a special case of a callback failing for some reason; any well-designed callback API should offer a way to report back "failure" in some way, be it via an exception, a return code (plus hopefully a data block with more info), or whatever. If the API is not well-designed, the best the callback can do in case of failure is to die with an error message.