The error read-only property of the IDBRequest interface returns the error in the event of an unsuccessful request.
error
MDN Reference