IndexedDB-错误会一直扩展到IDBOpenDBRequest吗? [英] IndexedDB - Do errors bubble all the way to IDBOpenDBRequest?

查看:147
本文介绍了IndexedDB-错误会一直扩展到IDBOpenDBRequest吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我第一次使用indexedDB,并且mozilla文档指出错误会一直冒到数据库"实例.

I’m using indexedDB for the first time, and the mozilla documentation states that errors bubble all the way to the "database" instance.

据我了解,此系统中的事件传播完全继承自DOM事件模型.

It’s my understanding that event propagation in this system is entirely inherited from the DOM event model.

我很好奇,是什么意思是错误会一直冒泡到IDBOpenDBRequest(由indexedDB.open()实例化).

I’m curious if what is meant is that errors will bubble all the way to IDBOpenDBRequest (that which is instantiated with indexedDB.open()).

文档指出,您可以将onerror事件处理程序附加到顶级IDB实例,并且可以在一个处理程序中拦截所有错误.如果将它附加到IDBOpenDBRequest,这对我来说更有意义,因为它确实处于最高级别.但是,它的解释方式听起来好像是气泡行的末尾实际上是IDBDatabase?

The documentation states that you can attach an onerror event handler to the top level IDB instances and it can intercept all your errors in one handler. This makes more sense to me if this is attached to IDBOpenDBRequest because it is truly at the highest level. However, the way it’s explained makes it sound like it’s actually IDBDatabase that is the end of the bubbling line?

推荐答案

否.事件从请求(IDBRequest)到事务(IDBTransaction)到连接(IDBDatabase)冒泡-就是这样.

No. Events bubble from request (IDBRequest) to transaction (IDBTransaction) to connection (IDBDatabase) - that's it.

规范中搜索获取父母",这是事件发生地点的规范语言气泡.

Search in the spec for "get the parent" which is spec language for where the event bubbles.

这篇关于IndexedDB-错误会一直扩展到IDBOpenDBRequest吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆