Reject on no plugin

This commit is contained in:
Max Lynch 2015-11-24 18:15:14 -06:00
parent 51d1ad75f6
commit cccfb60a4f
3 changed files with 7 additions and 1 deletions

View File

@ -1089,6 +1089,9 @@ var promisifyCordova = function promisifyCordova(pluginObj, pluginName, methodNa
if (!pluginObj.installed()) {
console.warn('Cordova: tried calling', '"' + pluginName + '.' + methodName + '"', 'but the ' + pluginObj.plugin + ' plugin is not installed.');
reject({
error: 'plugin_not_installed'
});
return;
}
console.log('Cordova: exec(' + pluginName + ', ' + methodName + ')');

File diff suppressed because one or more lines are too long

3
src/cordova.js vendored
View File

@ -14,6 +14,9 @@ const promisifyCordova = (pluginObj, pluginName, methodName) => {
if(!pluginObj.installed()) {
console.warn('Cordova: tried calling', '"' + pluginName + '.' + methodName + '"', 'but the ' + pluginObj.plugin + ' plugin is not installed.');
reject({
error: 'plugin_not_installed'
});
return;
}
console.log('Cordova: exec(' + pluginName + ', ' + methodName +')');