diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-10-29 09:23:19 -0700 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-10-29 09:23:19 -0700 |
commit | 2534c3bc7843ee7249e53d4bc404a6f08deffd12 (patch) | |
tree | fe14696c0624498f57eaaf633542f926f3160cca | |
parent | f5e0d59dbf569105814d90b03999f0072bf3842c (diff) | |
parent | 71cf83b314d4f016b0bd10673250f494e8643d71 (diff) | |
download | nextcloud-server-2534c3bc7843ee7249e53d4bc404a6f08deffd12.tar.gz nextcloud-server-2534c3bc7843ee7249e53d4bc404a6f08deffd12.zip |
Merge pull request #5606 from owncloud/files-uploaderrorparsingfix
Added fix to correctly parse non-array error messages
-rw-r--r-- | apps/files/js/file-upload.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js index 5bf4f5c0981..95c0723f254 100644 --- a/apps/files/js/file-upload.js +++ b/apps/files/js/file-upload.js @@ -334,8 +334,13 @@ $(document).ready(function() { var result=$.parseJSON(response); delete data.jqXHR; - - if (typeof result[0] === 'undefined') { + + if (result.status === 'error' && result.data && result.data.message){ + data.textStatus = 'servererror'; + data.errorThrown = result.data.message; + var fu = $(this).data('blueimp-fileupload') || $(this).data('fileupload'); + fu._trigger('fail', e, data); + } else if (typeof result[0] === 'undefined') { data.textStatus = 'servererror'; data.errorThrown = t('files', 'Could not get result from server.'); var fu = $(this).data('blueimp-fileupload') || $(this).data('fileupload'); |