diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2015-12-07 13:56:53 +0300 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2015-12-10 11:18:56 +0300 |
commit | c190d9506c7fa1af133ca4a38e848fd9de5cb95b (patch) | |
tree | 0fb89b917388104ecc5a800769523e2fa6f51f2a /js | |
parent | 561968a3b21040bffb4696b4536f16bcba8a5baa (diff) |
Display the error message when one was given
Diffstat (limited to 'js')
-rw-r--r-- | js/editor.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/js/editor.js b/js/editor.js index ba9404b..1c1e4cf 100644 --- a/js/editor.js +++ b/js/editor.js @@ -118,7 +118,11 @@ var Files_Texteditor = { }, function(message){ // Boo - $('small.saving-message').text(t('files_texteditor', 'failed!')); + if (typeof message == 'undefined') { + $('small.saving-message').text(t('files_texteditor', 'failed!')); + } else { + $('small.saving-message').text(message); + } OCA.Files_Texteditor.saveMessageTimeout = setTimeout(function() { $('small.saving-message').fadeOut(200); }, 5000); @@ -523,7 +527,14 @@ var Files_Texteditor = { }) .done(success) .fail(function(jqXHR) { - failure(JSON.parse(jqXHR.responseText).message); + var message; + + try{ + message = JSON.parse(jqXHR.responseText).message; + }catch(e){ + } + + failure(message); }); }, |