summaryrefslogtreecommitdiff
path: root/www/js/importer.js
diff options
context:
space:
mode:
Diffstat (limited to 'www/js/importer.js')
-rw-r--r--www/js/importer.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/www/js/importer.js b/www/js/importer.js
index 1da9d1a..c813f1a 100644
--- a/www/js/importer.js
+++ b/www/js/importer.js
@@ -338,7 +338,7 @@ Rdxport.Upload.prototype.onerror = function(error) {
var file = {
cartNumber: this.cartNumber || this.newCartNumber
};
- this.importFileUploadError(file, error);
+ this.importFileUploadError(file, 500, error);
};
Rdxport.Upload.prototype.onmessage = function(event) {
@@ -350,7 +350,7 @@ Rdxport.Upload.prototype.onmessage = function(event) {
switch (data.TYPE.toLowerCase()) {
case Rdxport.Importer.TYPE_ERROR:
console.log(data);
- this.importFileUploadError(file, data.ERROR_STRING);
+ this.importFileUploadError(file, data.RESPONSE_CODE, data.ERROR_STRING);
break;
case Rdxport.Importer.TYPE_PROGRESS:
this.uploadprogress.current = data.CURRENT;
@@ -362,7 +362,11 @@ Rdxport.Upload.prototype.onmessage = function(event) {
break;
case Rdxport.Importer.TYPE_DONE:
console.log(data);
- this.importFileUploadSuccess();
+ if(data.RESPONSE_CODE < 400) {
+ this.importFileUploadSuccess();
+ } else {
+ this.importFileUploadError(file, data.RESPONSE_CODE, data.ERROR_STRING);
+ }
break;
}
@@ -472,9 +476,9 @@ Rdxport.Upload.prototype.importFileUploadSuccess = function() {
this.group.fetchCarts();
};
-Rdxport.Upload.prototype.importFileUploadError = function(file, msg, xhr) {
+Rdxport.Upload.prototype.importFileUploadError = function(file, status, errorString) {
var self = this;
- this.groupView.uploadError(this, file, msg, xhr, function() {
+ this.groupView.uploadError(this, file, status, errorString, function() {
self.cancel();
});
};