Complete future with an error.
Completing a future with an error indicates that an exception was thrown while trying to produce a value.
error must not be
error is a
Future, the future itself is used as the error value.
If you want to complete with the result of the future, you can use:
or if you only want to handle an error from the future:
void completeError(Object error, [StackTrace stackTrace]);