angular-indexedDB icon indicating copy to clipboard operation
angular-indexedDB copied to clipboard

Wrong usage of @defer.reject()

Open devgru opened this issue 8 years ago • 6 comments

Here we call @defer.reject() with two arguments: https://github.com/bramski/angular-indexedDB/blob/master/src/angular-indexed-db.coffee#L161-L171

The second argument of reject method is ignored, so actual error is lost and we just get "Transaction Error" string in promise.

devgru avatar Jun 27 '16 08:06 devgru

What form of rejection would be preferred?

bramski avatar Jun 29 '16 16:06 bramski

IMHO actual error is enough.

Maybe it's a good idea to reject with object, like this:

@defer.reject({title: "Transaction Aborted", error: error})
@defer.reject({title: "Transaction Error", error: error})

devgru avatar Jul 03 '16 20:07 devgru

@bramski will it be useful if I write PR with this change?

devgru avatar Jul 11 '16 10:07 devgru

Yes for sure. On Jul 11, 2016 3:13 AM, "Dmitriy Semyushkin" [email protected] wrote:

@bramski https://github.com/bramski will it be useful if I write PR with this change?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bramski/angular-indexedDB/issues/65#issuecomment-231695215, or mute the thread https://github.com/notifications/unsubscribe/AAZvlYKjxhqpR-PjdN3UUA3lF8317EIuks5qUhdNgaJpZM4I-4Sj .

bramski avatar Jul 11 '16 14:07 bramski

Here you are: https://github.com/bramski/angular-indexedDB/pull/66

devgru avatar Jul 16 '16 13:07 devgru

Merged.

bramski avatar Oct 26 '16 04:10 bramski