I've only found old threads regarding this where all proposed solutions look like hacks to me, like adding "recoverwith" to every future manually everywhere. I want my scala futures to always have a default onComplete handler that logs the exception. Otherwise, exceptions get silently dropped by default, and that is a bad default behaviour.
Asked
Active
Viewed 71 times
3
-
3Create an ExecutionContext from an execution service that does logging of exceptions. And use it in all of your futures. https://stackoverflow.com/questions/2248131/handling-exceptions-from-java-executorservice-tasks – Ivan Stanislavciuc May 06 '20 at 08:25
-
I'm not experienced enough to know if this is a valid answer or not. But why doesn't anyone suggest Zio for problems like this? – mtk May 06 '20 at 19:34