@@ -2182,7 +2182,7 @@ function find(resourceName, id, options) {
2182
2182
}
2183
2183
} , function ( err ) {
2184
2184
delete resource . pendingQueries [ id ] ;
2185
- return err ;
2185
+ return _this . $q . reject ( err ) ;
2186
2186
} ) ;
2187
2187
}
2188
2188
@@ -2243,14 +2243,14 @@ function _findAll(utils, resourceName, params, options) {
2243
2243
try {
2244
2244
return processResults . apply ( _this , [ utils , data , resourceName , queryHash ] ) ;
2245
2245
} catch ( err ) {
2246
- throw new _this . errors . UnhandledError ( err ) ;
2246
+ return _this . $q . reject ( _this . errors . UnhandledError ( err ) ) ;
2247
2247
}
2248
2248
} else {
2249
2249
return data ;
2250
2250
}
2251
2251
} , function ( err ) {
2252
2252
delete resource . pendingQueries [ queryHash ] ;
2253
- return err ;
2253
+ return _this . $q . reject ( err ) ;
2254
2254
} ) ;
2255
2255
}
2256
2256
@@ -4220,13 +4220,14 @@ function get(resourceName, id, options) {
4220
4220
} else if ( ! this . utils . isObject ( options ) ) {
4221
4221
throw new this . errors . IllegalArgumentError ( errorPrefix + 'options: Must be an object!' , { options : { actual : typeof options , expected : 'object' } } ) ;
4222
4222
}
4223
+ var _this = this ;
4223
4224
4224
4225
try {
4225
4226
// cache miss, request resource from server
4226
4227
var item = this . store [ resourceName ] . index . get ( id ) ;
4227
4228
if ( ! item && options . loadFromServer ) {
4228
4229
this . find ( resourceName , id ) . then ( null , function ( err ) {
4229
- throw err ;
4230
+ return _this . $q . reject ( err ) ;
4230
4231
} ) ;
4231
4232
}
4232
4233
@@ -4963,7 +4964,7 @@ module.exports = [function () {
4963
4964
* @id angular-data
4964
4965
* @name angular-data
4965
4966
* @description
4966
- * __Version:__ 0.9.0
4967
+ * __Version:__ 0.9.1
4967
4968
*
4968
4969
* ## Install
4969
4970
*
0 commit comments