File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 1010 */
1111RMModule . factory ( 'RMFastQ' , [ function ( ) {
1212
13- var isFunction = angular . isFunction ;
13+ var isFunction = angular . isFunction ,
14+ catchError = function ( _error ) {
15+ return this . then ( null , _error ) ;
16+ } ;
1417
1518 function simpleQ ( _val , _withError ) {
1619
@@ -22,6 +25,7 @@ RMModule.factory('RMFastQ', [function() {
2225 then : function ( _success , _error ) {
2326 return simpleQ ( _withError ? _error ( _val ) : _success ( _val ) ) ;
2427 } ,
28+ 'catch' : catchError ,
2529 'finally' : function ( _cb ) {
2630 var result = _cb ( ) ;
2731 if ( result && isFunction ( _val . then ) ) {
@@ -55,6 +59,7 @@ RMModule.factory('RMFastQ', [function() {
5559 simple . then ( _success , _error ) :
5660 wrappedQ ( _promise . then ( _success , _error ) ) ;
5761 } ,
62+ 'catch' : catchError ,
5863 'finally' : function ( _cb ) {
5964 return simple ?
6065 simple [ 'finally' ] ( _cb ) :
You can’t perform that action at this time.
0 commit comments