# Check a Future object for remote errors

**URL:** <https://discourse.julialang.org/t/check-a-future-object-for-remote-errors/53768>\
**Category:** General Usage\
**Tags:** distributed\
**Created:** [January 22, 2021, 8:34am UTC](https://discourse.julialang.org/t/check-a-future-object-for-remote-errors/53768 "2021-01-22T08:34:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![matthiasbe](https://avatars.discourse-cdn.com/v4/letter/m/5fc32e/32.png) [@matthiasbe](https://discourse.julialang.org/u/matthiasbe)\
**Post date:** [January 22, 2021, 8:34am UTC](https://discourse.julialang.org/t/check-a-future-object-for-remote-errors/53768/1 "2021-01-22T08:34:32Z")

</div>

Is it possible to check a `Future` object for any remote error without actually retrieving the remotely computed data ? Sometimes the data is very large and using a `fetch()` result in undesired large data mouvement.

Consider the following example

```julia
using DistributedArrays

A = drand((1000,1000),workers())
B = drand((2000,2000),workers())

# Compute the sum A+B on each worker. This produces an error because the sizes don't match
AB_future = [@spawnat p B[:l] + A[:l] for p in workers()]

AB = DArray(reshape(AB_future, (2,2)))

```

The last line throws an error `MethodError: no method matching size(::RemoteException)`

I would rather have this `RemoteException` displayed.

I tried the following as a workaround.

```julia
using DistributedArrays

A = drand((1000,1000),workers())
B = drand((2000,2000),workers())

# Compute the sum A+B on each worker. This produces an error because the sizes don't match
AB_future = [@spawnat p B[:l] + A[:l] for p in workers()]
for f in AB_future
  println(fetch(f))
end
AB = DArray(reshape(AB_future, (2,2)))

```

It is not suitable as it performs a useless data mouvement.

How can I perform this check without retrieving the remote data ?

---

<div class="post-metadata">

**Author:** ![matthiasbe](https://avatars.discourse-cdn.com/v4/letter/m/5fc32e/32.png) [@matthiasbe](https://discourse.julialang.org/u/matthiasbe)\
**Post date:** [January 22, 2021, 8:51am UTC](https://discourse.julialang.org/t/check-a-future-object-for-remote-errors/53768/2 "2021-01-22T08:51:23Z")

</div>

Maybe calling `fetch(f)` without left hand side is not actually doing any data mouvement ?
