diff --git a/assets/javascripts/discourse/controllers/admin-plugins-explorer.js.es6 b/assets/javascripts/discourse/controllers/admin-plugins-explorer.js.es6 index 4da50b7..63878ac 100644 --- a/assets/javascripts/discourse/controllers/admin-plugins-explorer.js.es6 +++ b/assets/javascripts/discourse/controllers/admin-plugins-explorer.js.es6 @@ -182,9 +182,13 @@ export default Ember.ArrayController.extend({ } self.set('showResults', true); - }).catch(function(result) { + }).catch(function(err) { self.set('showResults', false); - self.set('results', result); + if (err.jqXHR && err.jqXHR.status === 422 && err.jqXHR.responseJSON) { + self.set('results', err.jqXHR.responseJSON); + } else { + popupAjaxError(err); + } }).finally(function() { self.set('loading', false); }); diff --git a/plugin.rb b/plugin.rb index 5bb6c22..d01cf33 100644 --- a/plugin.rb +++ b/plugin.rb @@ -720,7 +720,7 @@ SQL render json: { success: false, errors: [err_msg] - } + }, status: 422 else pg_result = result[:pg_result] cols = pg_result.fields