catch some runtime errors in current context

10.3.x-maintenance
cTn 2014-09-22 21:16:52 +02:00
parent 2088a49b15
commit 177498bd20
1 changed files with 10 additions and 2 deletions

View File

@ -48,9 +48,13 @@ function configuration_backup() {
// create or load the file
chrome.fileSystem.chooseEntry({type: 'saveFile', suggestedName: 'baseflight_backup_' + now, accepts: accepts}, function (fileEntry) {
if (chrome.runtime.lastError) {
console.error(chrome.runtime.lastError.message);
return;
}
if (!fileEntry) {
console.log('No file selected, backup aborted.');
return;
}
@ -127,9 +131,13 @@ function configuration_restore() {
// load up the file
chrome.fileSystem.chooseEntry({type: 'openFile', accepts: accepts}, function (fileEntry) {
if (chrome.runtime.lastError) {
console.error(chrome.runtime.lastError.message);
return;
}
if (!fileEntry) {
console.log('No file selected, restore aborted.');
return;
}