fix(extension): bypass the error returned by plugin service during ex… (#1586)

* fix(extension): bypass the error returned by plugin service during extension check

* feat(plugins): bypass the error returned by plugin service during plugin retrieval
pull/1602/head
Anthony Lapenna 7 years ago committed by GitHub
parent 8c75f705e2
commit 173ea372c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -5,16 +5,17 @@ angular.module('portainer.services')
service.plugins = function() {
var deferred = $q.defer();
var plugins = [];
Plugin.query({}).$promise
.then(function success(data) {
var plugins = data.map(function (item) {
return new PluginViewModel(item);
});
deferred.resolve(plugins);
for (var i = 0; i < data.length; i++) {
var plugin = new PluginViewModel(data[i]);
plugins.push(plugin);
}
})
.catch(function error(err) {
deferred.reject({ msg: 'Unable to retrieve plugins', err: err });
.finally(function final() {
deferred.resolve(plugins);
});
return deferred.promise;
@ -61,7 +62,7 @@ angular.module('portainer.services')
};
service.loggingPlugins = function(systemOnly) {
return servicePlugins(systemOnly, 'Log', 'docker.logdriver/1.0');
return servicePlugins(systemOnly, 'Log', 'docker.logdriver/1.0');
};
return service;

@ -23,10 +23,9 @@ angular.module('portainer.services')
if (_.includes(volumePlugins, 'cio:latest')) {
extensions.push('storidge');
}
deferred.resolve(extensions);
})
.catch(function error(err) {
deferred.reject({ msg: 'Unable to retrieve extensions', err: err });
.finally(function final() {
deferred.resolve(extensions);
});
return deferred.promise;

Loading…
Cancel
Save