在调用add或put-in-IndexedDB时,如何找出导致错误的索引?

在调用add或put-in-IndexedDB时,如何找出导致错误的索引?,indexeddb,Indexeddb,无论何时使用unique=true创建索引,调用add或put时都可以返回constraint 可以从IDBReaquest.error读取的错误是一个DOMEException,它没有足够的信息。以下是Chrome的回报: {name:'ConstraintError', message: 'Unable to add key to index 'country-city': at least one key does not satisfy the uniqueness requiremen

无论何时使用
unique=true
创建索引,调用add或put时都可以返回
constraint

可以从
IDBReaquest.error
读取的错误是一个
DOMEException
,它没有足够的信息。以下是Chrome的回报:

{name:'ConstraintError', message: 'Unable to add key to index 'country-city': at least one key does not satisfy the uniqueness requirements.'}
,以及Firefox:

{name:'ConstraintError', message: 'A mutation operation in the transaction failed because a constraint was not satisfied.'}
很明显,浏览器知道导致错误的索引

但有人知道找到答案的方法吗