Bubble up InvalidStateErrors and log them
These may be indicative of a potentially fatal lack of disk space. // FREEBIE
This commit is contained in:
parent
83629df560
commit
e5b54d9b6a
3 changed files with 20 additions and 0 deletions
|
@ -562,7 +562,15 @@
|
||||||
// Executes a given command on the driver. If not started, just stacks up one more element.
|
// Executes a given command on the driver. If not started, just stacks up one more element.
|
||||||
execute: function (message) {
|
execute: function (message) {
|
||||||
if (this.started) {
|
if (this.started) {
|
||||||
|
try {
|
||||||
this.driver.execute(message[2].storeName || message[1].storeName, message[0], message[1], message[2]); // Upon messages, we execute the query
|
this.driver.execute(message[2].storeName || message[1].storeName, message[0], message[1], message[2]); // Upon messages, we execute the query
|
||||||
|
} catch (e) {
|
||||||
|
if (e.name === 'InvalidStateError') {
|
||||||
|
var f = window.onInvalidStateError;
|
||||||
|
if (f) f(e);
|
||||||
|
}
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
} else if (this.failed) {
|
} else if (this.failed) {
|
||||||
message[2].error();
|
message[2].error();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -4,6 +4,10 @@
|
||||||
|
|
||||||
;(function() {
|
;(function() {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
window.onInvalidStateError = function(e) {
|
||||||
|
console.log(e);
|
||||||
|
};
|
||||||
|
|
||||||
console.log('background page reloaded');
|
console.log('background page reloaded');
|
||||||
// register some chrome listeners
|
// register some chrome listeners
|
||||||
if (chrome.notifications) {
|
if (chrome.notifications) {
|
||||||
|
|
|
@ -21920,7 +21920,15 @@ return jQuery;
|
||||||
// Executes a given command on the driver. If not started, just stacks up one more element.
|
// Executes a given command on the driver. If not started, just stacks up one more element.
|
||||||
execute: function (message) {
|
execute: function (message) {
|
||||||
if (this.started) {
|
if (this.started) {
|
||||||
|
try {
|
||||||
this.driver.execute(message[2].storeName || message[1].storeName, message[0], message[1], message[2]); // Upon messages, we execute the query
|
this.driver.execute(message[2].storeName || message[1].storeName, message[0], message[1], message[2]); // Upon messages, we execute the query
|
||||||
|
} catch (e) {
|
||||||
|
if (e.name === 'InvalidStateError') {
|
||||||
|
var f = window.onInvalidStateError;
|
||||||
|
if (f) f(e);
|
||||||
|
}
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
} else if (this.failed) {
|
} else if (this.failed) {
|
||||||
message[2].error();
|
message[2].error();
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue