Browse Source

Show error from server in upload-dialog

Tobias Reich 9 years ago
parent
commit
c0d2f4b5b8
2 changed files with 7 additions and 2 deletions
  1. 0 0
      dist/main.js
  2. 7 2
      src/scripts/upload.js

File diff suppressed because it is too large
+ 0 - 0
dist/main.js


+ 7 - 2
src/scripts/upload.js

@@ -110,7 +110,8 @@ upload = {
 
 					xhr.onload = function() {
 
-						var wait = false;
+						var wait = false,
+							errorText = "";
 
 						file.ready = true;
 
@@ -128,8 +129,12 @@ upload = {
 							$(".upload_message .rows .row:nth-child(" + (file.num+1) + ") .status")
 								.html("Error")
 								.addClass("error");
+
+							if (xhr.responseText.substr(0, 6)==="Error:") errorText = xhr.responseText.substr(6) + " Please take a look at the console of your browser for further details.";
+							else errorText = "Server returned an unknown response. Please take a look at the console of your browser for further details.";
+
 							$(".upload_message .rows .row:nth-child(" + (file.num+1) + ") p.notice")
-								.html("Server returned an unknown response. Please take a look at the console of your browser for further details.")
+								.html(errorText)
 								.show();
 
 							// Set global error

Some files were not shown because too many files changed in this diff