Bug 769537: Actually use QuotaExceededError for database creation. r=bent

This commit is contained in:
Kyle Huey 2012-06-29 09:48:34 -07:00
Родитель cb9671068e
Коммит c0b8b36893
1 изменённых файлов: 11 добавлений и 2 удалений

Просмотреть файл

@ -1636,7 +1636,11 @@ OpenDatabaseHelper::DoDatabaseWork()
nsCOMPtr<mozIStorageConnection> connection;
rv = CreateDatabaseConnection(mName, dbFile, fileManagerDirectory,
getter_AddRefs(connection));
NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
if (NS_FAILED(rv) &&
NS_ERROR_GET_MODULE(rv) != NS_ERROR_MODULE_DOM_INDEXEDDB) {
rv = NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
}
NS_ENSURE_SUCCESS(rv, rv);
rv = IDBFactory::LoadDatabaseInformation(connection, mDatabaseId,
&mCurrentVersion, mObjectStores);
@ -1838,6 +1842,11 @@ OpenDatabaseHelper::CreateDatabaseConnection(
}
rv = transaction.Commit();
if (rv == NS_ERROR_FILE_NO_DEVICE_SPACE) {
// mozstorage translates SQLITE_FULL to NS_ERROR_FILE_NO_DEVICE_SPACE,
// which we know better as NS_ERROR_DOM_INDEXEDDB_QUOTA_ERR.
rv = NS_ERROR_DOM_INDEXEDDB_QUOTA_ERR;
}
NS_ENSURE_SUCCESS(rv, rv);
}