From 761da1e9360c484e292c66324a0a818248116d24 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Thu, 24 Mar 2016 22:22:59 +0100 Subject: [PATCH] Improved upload messages --- src/scripts/upload.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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