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

Add better onerror handling. #326

Open
fungairino opened this issue Oct 2, 2024 · 2 comments
Open

Add better onerror handling. #326

fungairino opened this issue Oct 2, 2024 · 2 comments

Comments

@fungairino
Copy link

It seems like in cases where there is no error on the transaction, a generic AbortError is thrown. However if you inspect the error argument (which is not used) you can actually see the real error that was encountered. This is applicable to the "DataError: Failed to read large IndexedDB value" error

See:

const error = () => {
reject(tx.error || new DOMException('AbortError', 'AbortError'));

The expectation would be that we should see the real cause, and not swallow it.

@fungairino
Copy link
Author

Related to this issue, it seems like this Promise also is running into uncaught error calls as well.

Uncaught (in promise) AbortError: AbortError

The stack trace points to the promise created by this line: https://github.com/jakearchibald/idb/blob/main/src/wrap-idb-value.ts#L164

Seems like this needs a similar fix like the one done here where we just catch the rejected error.

(Related issue on uncaught promise errors: #115)

@jakearchibald
Copy link
Owner

Thanks for reporting. I'll take a look.

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