2
0
mirror of https://github.com/esiur/esiur-dart.git synced 2025-09-29 18:53:19 +00:00
This commit is contained in:
2021-02-20 00:10:06 +03:00
parent 4c36f591da
commit cb8e6d5430
9 changed files with 637 additions and 681 deletions

View File

@@ -89,6 +89,10 @@ class AsyncReply<T> implements Future<T>
{
_errorCallbacks.add((ex)=>onError());
}
else if (onError is Function(Object, StackTrace))
{
_errorCallbacks.add((ex)=>onError(ex, null));
}
}
@@ -169,10 +173,17 @@ class AsyncReply<T> implements Future<T>
if (_resultReady)
return;
_exception = AsyncException.toAsyncException(exception);
if (exception is AsyncException)
_exception = exception;
else
_exception = AsyncException.toAsyncException(exception);
///lock (callbacksLock)
//{
if (this._errorCallbacks.length == 0)
throw _exception;
else
_errorCallbacks.forEach((x) {
x(_exception);
});