Merge pull request #167 from kwkofler/issue#136

Issue #136 - Added more verbose errors for situations where Private Brow...
This commit is contained in:
Alan K 2014-04-02 20:00:42 -04:00
commit 073fe45223
2 changed files with 6 additions and 1 deletions

View File

@ -9,6 +9,7 @@ define(function(require) {
var IDB_RW = require('src/constants').IDB_RW;
var IDB_RO = require('src/constants').IDB_RO;
var Errors = require('src/errors');
function IndexedDBContext(db, mode) {
var transaction = db.transaction(FILE_STORE_NAME, mode);
@ -112,7 +113,7 @@ define(function(require) {
callback(null, firstAccess);
};
openRequest.onerror = function onerror(error) {
callback(error);
callback(new Errors.EINVAL('IndexedDB cannot be accessed. If private browsing is enabled, disable it.'));
};
};
IndexedDB.prototype.getReadOnlyContext = function() {

View File

@ -5,6 +5,7 @@ define(function(require) {
var WSQL_SIZE = require('src/constants').WSQL_SIZE;
var WSQL_DESC = require('src/constants').WSQL_DESC;
var u8toArray = require('src/shared').u8toArray;
var Errors = require('src/errors');
function WebSQLContext(db, isReadOnly) {
var that = this;
@ -116,6 +117,9 @@ define(function(require) {
}
function onError(transaction, error) {
if (error.code === 5) {
callback(new Errors.EINVAL('WebSQL cannot be accessed. If private browsing is enabled, disable it.'));
}
callback(error);
}
function onSuccess(transaction, result) {