Fork me on GitHub
#core-async
<
2022-10-29
>
jjttjj15:10:34

(a/<!! (a/map vector [(a/thread 1) (a/thread 2)])) ;;=> [1 2]
  (a/<!! (a/map vector [(a/thread 1) (a/thread nil)])) ;;=> nil (silent failure?)
I have a Thread/setDefaultUncaughtExceptionHandler set to print uncaught exceptions but nothing is printed when the failure occurs. Is this related to the "nil on channel" being an assertion error that isn't handled by the UncaughtExceptionHandler? Is there a way to somehow recognize or catch the error from a thread returning nil?

Jan K16:10:05

There is no error happening. When a/map receives nil (closed channel) on any of the inputs it stops, as documented.

Jan K16:10:53

It is similar to doing (map vector [1] []), where the "1" doesn't occur in the result

jjttjj16:10:38

ah, thanks! that makes sense