feat(injector): change injector to show the full path when error happens in a constructor (async)

This commit is contained in:
vsavkin
2014-10-07 09:04:11 -04:00
parent e7666d0612
commit 62004e22e0
4 changed files with 44 additions and 4 deletions

View File

@ -8,7 +8,15 @@ class FutureWrapper {
return new Future.value(obj);
}
static Future error(obj) {
return new Future.error(obj);
}
static Future wait(List<Future> futures){
return Future.wait(futures);
}
static Future catchError(Future future, Function onError){
return future.catchError(onError);
}
}

View File

@ -5,8 +5,16 @@ export class FutureWrapper {
return Future.resolve(obj);
}
static error(obj):Future {
return Future.reject(obj);
}
static wait(futures):Future {
if (futures.length == 0) return Future.resolve([]);
return Future.all(futures);
}
static catchError(future:Future, onError:Function):Future {
return future.catch(onError);
}
}