diff --git a/src/scripts/upload.js b/src/scripts/upload.js index 9fc4ca6..6b42981 100755 --- a/src/scripts/upload.js +++ b/src/scripts/upload.js @@ -120,6 +120,9 @@ upload.start = { .html('Failed') .addClass('error') + // Throw error + if (error===true) lychee.error('Upload failed. Server returned an error!', xhr, xhr.responseText) + } else if (xhr.responseText.substr(0, 8)==='Warning:') { errorText = xhr.responseText.substr(8) @@ -130,6 +133,9 @@ upload.start = { .html('Skipped') .addClass('warning') + // Throw error + if (error===true) lychee.error('Upload failed. Server returned a warning!', xhr, xhr.responseText) + } else { errorText = 'Server returned an unknown response. Please take a look at the console of your browser for further details.' @@ -140,15 +146,15 @@ upload.start = { .html('Failed') .addClass('error') + // Throw error + if (error===true) lychee.error('Upload failed. Server returned an unkown error!', xhr, xhr.responseText) + } $('.basicModal .rows .row:nth-child(' + (file.num + 1) + ') p.notice') .html(errorText) .show() - // Throw error - if (error===true) lychee.error('Upload failed. Server returned the status code ' + xhr.status + '!', xhr, xhr.responseText) - } // Check if there are file which are not finished