<p dir="auto">Using</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="pmap(sqrt,[-1]); &quot;some other return val&quot;"><pre class="notranslate"><code class="notranslate">pmap(sqrt,[-1]); "some other return val"
</code></pre></div>
<p dir="auto">hides the error to be displayed to stdout.</p>
<p dir="auto">This also partially applied to warnings, but I couldn't find a simple way to reproduce it (<code class="notranslate">pmap(warn,["warning"])</code> actually shows the warning, but nested warnings in my real life code actually don't get displayed).</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@everywhere function do_work(i)
    r = [1,2,3][i]
    println(r)
    return r
end

for r in pmap(do_work, [3,2,1,0])
    println(&quot;pmap got result&quot;)
    println(typeof(r))
end"><pre class="notranslate"><span class="pl-c1">@everywhere</span> <span class="pl-k">function</span> <span class="pl-en">do_work</span>(i)
    r <span class="pl-k">=</span> [<span class="pl-c1">1</span>,<span class="pl-c1">2</span>,<span class="pl-c1">3</span>][i]
    <span class="pl-c1">println</span>(r)
    <span class="pl-k">return</span> r
<span class="pl-k">end</span>

<span class="pl-k">for</span> r <span class="pl-k">in</span> <span class="pl-c1">pmap</span>(do_work, [<span class="pl-c1">3</span>,<span class="pl-c1">2</span>,<span class="pl-c1">1</span>,<span class="pl-c1">0</span>])
    <span class="pl-c1">println</span>(<span class="pl-s"><span class="pl-pds">"</span>pmap got result<span class="pl-pds">"</span></span>)
    <span class="pl-c1">println</span>(<span class="pl-c1">typeof</span>(r))
<span class="pl-k">end</span></pre></div>
<p dir="auto">The <code class="notranslate">pmap()</code> call above returns a RemoteException object in the result array instead of re-throwing it.</p>
<p dir="auto">The output is:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="./julia -p4 test.jl
    From worker 3:  2
    From worker 4:  1
    From worker 2:  3
pmap got result
Int64
pmap got result
Int64
pmap got result
Int64
pmap got result
RemoteException"><pre class="notranslate"><code class="notranslate">./julia -p4 test.jl
    From worker 3:  2
    From worker 4:  1
    From worker 2:  3
pmap got result
Int64
pmap got result
Int64
pmap got result
Int64
pmap got result
RemoteException
</code></pre></div>
<p dir="auto">Changing <code class="notranslate">pmap()</code> to <code class="notranslate">map()</code> results in BoundsError as expected.</p>