Return error code when problems opening Indexeddb