Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global exception handler for promises #69

Closed
janmisek opened this issue Mar 5, 2015 · 2 comments
Closed

Global exception handler for promises #69

janmisek opened this issue Mar 5, 2015 · 2 comments

Comments

@janmisek
Copy link

janmisek commented Mar 5, 2015

Dexie.on.error consumes only database/transaction exceptions. There is discussed issue #43 which clarify the behaviour. But I would say Dexie promises needs the global exception handler.

I am chaining the promises very much, also combining with other Promise/A+ implementation. Also using global exception handler for whole application which push the exceptions to server logs.

With current Dexie implementation I have to explicitly catch each exception in promise and push it to global exception handler. Also other promises implementation has the global onerror event, so this makes Dexie pretty much incompatibile with rest of my app.

@dfahlander
Copy link
Collaborator

I got it. It makes sense indeed to have a global exception event as a static property on Promise.

I'll keep the issue open as a todo item. Hopefully to be implementet in the coming month.

Thanks for sharing!
David

dfahlander added a commit that referenced this issue Mar 20, 2015
Introducing Promise.on("error") - global error event that not only
catched failing transactions (like db.on("error")) but also operations
that happen outside a transaction or database operation.
@dfahlander
Copy link
Collaborator

Implemented in src/Dexie.js and added documentation for it on the wiki.
Will be part of Dexie v1.0.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants