Re: [w3c/IndexedDB] Integrate with window.onerror (#49)

I don't think we have a strong opinion on the Firefox side at this time.  My inclination would be to stick with the status quo. My rationale is:
- Needing to call preventDefault() technically makes sense from an HTML/DOM perspective, but is arguably not intuitive for a database API, at least when it jumps to the global.  It is handy for the IDBDatabase/IDBTransaction/IDBRequest scenario.  And since we've largely moved over to using Promises for new API's like the Cache API, it makes even less sense to start bubbling to the global now.
- The contents of the ErrorEvents are not particularly useful, containing only location information for the most specific frame.  In the case where an IDB wrapper is used, the location info will have zero useful information.  In the case of direct IDB usage, it's still the case that if the request ever succeeds, then the problem is to be found in the data, not the call.  (Although the line number could provide some info.)
  - If attempting to improve the developer UX around IDB in Firefox, it wouldn't involve this error.
  - I would expect any production debugging tools/middleware to wrap the IDB API in order to get a more useful error out, as you say.
  - It'd be more useful to add an "errors" mode of operation on IDBObserver that would allow inspection of the database's state and the failed mutations.  This would be fun for middleware and devtools.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/IndexedDB/issues/49#issuecomment-422519247

Received on Tuesday, 18 September 2018 19:30:22 UTC