diff --git a/js/apps/system/aardvark/frontend/js/collections/arangoDocuments.js b/js/apps/system/aardvark/frontend/js/collections/arangoDocuments.js index 3f9077e846..f17422cdb5 100644 --- a/js/apps/system/aardvark/frontend/js/collections/arangoDocuments.js +++ b/js/apps/system/aardvark/frontend/js/collections/arangoDocuments.js @@ -272,10 +272,19 @@ dataType: 'json', complete: function(xhr) { if (xhr.readyState === 4 && xhr.status === 201) { - result = true; + result = true; } else { - result = "Upload error"; + result = "Upload error"; } + + try { + var data = JSON.parse(xhr.responseText); + if (data.errors > 0) { + result = "At least one error occurred during upload"; + } + } + catch (err) { + } } }); return result; diff --git a/js/apps/system/aardvark/frontend/js/templates/documentsView.ejs b/js/apps/system/aardvark/frontend/js/templates/documentsView.ejs index 97ca46a71f..3defbbc178 100644 --- a/js/apps/system/aardvark/frontend/js/templates/documentsView.ejs +++ b/js/apps/system/aardvark/frontend/js/templates/documentsView.ejs @@ -70,7 +70,7 @@ -
+
diff --git a/js/apps/system/aardvark/frontend/js/views/documentsView.js b/js/apps/system/aardvark/frontend/js/views/documentsView.js index fecdee5a9c..0cf937856a 100644 --- a/js/apps/system/aardvark/frontend/js/views/documentsView.js +++ b/js/apps/system/aardvark/frontend/js/views/documentsView.js @@ -195,13 +195,11 @@ this.showSpinner(); result = this.collection.uploadDocuments(this.file); if (result !== true) { - this.hideSpinner(); - if (result.substr(0, 5 ) === "Error") { - this.hideImportModal(); - this.resetView(); - } - arangoHelper.arangoError(result); - return; + this.hideSpinner(); + this.hideImportModal(); + this.resetView(); + arangoHelper.arangoError(result); + return; } this.hideSpinner(); this.hideImportModal();