Re: Trapping Concurrent.Future failures

"Stephen R. van den Berg" <[email protected]> Fri, 2 Aug 2019 11:30:00 +0200
Newsgroups gmane.comp.lang.pike.user
Message-ID <[email protected]>
Chris Angelico wrote:
>I'm currently converting some parts of a project from using myriad
>callbacks to returning a Concurrent.Future. One of the downsides is
>that unexpected errors are now being silenced; the Future is failing,
>but that doesn't do anything. Is there a way to set some sort of
>global callback to be triggered any time a Future failure is left
>unhandled?

//! Global failure callback, called when a promise without failure
//! callback fails. This is useful to log exceptions, so they are not
//! just silently caught and ignored.
Concurrent.on_failure(function(mixed : void) f);

Should do it.
-- 
Stephen.