diff --git a/lib/modules/Concurrent.pmod b/lib/modules/Concurrent.pmod index 160083762889ac6f4f9904b266148c4604b79a95..a0b383b458ddac205baf889022e6266b7adc271a 100644 --- a/lib/modules/Concurrent.pmod +++ b/lib/modules/Concurrent.pmod @@ -917,8 +917,20 @@ class Promise // in the executor will leave our caller with an error about the // Promise already having been finalized, not giving anyone too much // information about where the double-finalization occured... - if (err) - failure(err); + if (err) { + if (mixed err2 = catch(failure(err))) { + string finalisation_error; + + if (catch(finalisation_error = describe_error(err2))) + finalisation_error = sprintf("%O", err2); + + while (has_suffix(finalisation_error, "\n")) + finalisation_error = finalisation_error[..<1]; + + error("%O->create(): Got error \"%s\" while trying to finalise promise with %O thrown by executor.\n", + this, finalisation_error, err); + } + } } }