Skip to content

Commit

Permalink
MDL-83653 file manager: report ajax errors
Browse files Browse the repository at this point in the history
This is for things like when you click on a file, and then click on
the delete button, and an error happens then. Previously that was
ignored.
  • Loading branch information
timhunt committed Nov 8, 2024
1 parent cd5c991 commit a206f37
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/form/filemanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,12 @@ M.form_filemanager.init = function(Y, options) {
var data = null;
try {
data = Y.JSON.parse(o.responseText);
if (data.error) {
Y.use('moodle-core-notification-ajaxexception', function () {
return new M.core.ajaxException(data);
});
return;
}
} catch(e) {
scope.print_msg(M.util.get_string('invalidjson', 'repository'), 'error');
Y.error(M.util.get_string('invalidjson', 'repository')+":\n"+o.responseText);
Expand Down

0 comments on commit a206f37

Please sign in to comment.