@@ -2182,7 +2182,7 @@ function find(resourceName, id, options) {
21822182 }
21832183 } , function ( err ) {
21842184 delete resource . pendingQueries [ id ] ;
2185- return err ;
2185+ return _this . $q . reject ( err ) ;
21862186 } ) ;
21872187 }
21882188
@@ -2243,14 +2243,14 @@ function _findAll(utils, resourceName, params, options) {
22432243 try {
22442244 return processResults . apply ( _this , [ utils , data , resourceName , queryHash ] ) ;
22452245 } catch ( err ) {
2246- throw new _this . errors . UnhandledError ( err ) ;
2246+ return _this . $q . reject ( _this . errors . UnhandledError ( err ) ) ;
22472247 }
22482248 } else {
22492249 return data ;
22502250 }
22512251 } , function ( err ) {
22522252 delete resource . pendingQueries [ queryHash ] ;
2253- return err ;
2253+ return _this . $q . reject ( err ) ;
22542254 } ) ;
22552255 }
22562256
@@ -4220,13 +4220,14 @@ function get(resourceName, id, options) {
42204220 } else if ( ! this . utils . isObject ( options ) ) {
42214221 throw new this . errors . IllegalArgumentError ( errorPrefix + 'options: Must be an object!' , { options : { actual : typeof options , expected : 'object' } } ) ;
42224222 }
4223+ var _this = this ;
42234224
42244225 try {
42254226 // cache miss, request resource from server
42264227 var item = this . store [ resourceName ] . index . get ( id ) ;
42274228 if ( ! item && options . loadFromServer ) {
42284229 this . find ( resourceName , id ) . then ( null , function ( err ) {
4229- throw err ;
4230+ return _this . $q . reject ( err ) ;
42304231 } ) ;
42314232 }
42324233
@@ -4963,7 +4964,7 @@ module.exports = [function () {
49634964 * @id angular-data
49644965 * @name angular-data
49654966 * @description
4966- * __Version:__ 0.9.0
4967+ * __Version:__ 0.9.1
49674968 *
49684969 * ## Install
49694970 *
0 commit comments