Commit 9a410c6a authored by JC Brand's avatar JC Brand

updates #161 Proper error messages and include server response

parent e0aaeb66
......@@ -151,10 +151,7 @@
'message': this.get('get')
});
} else {
this.save({
'upload': _converse.FAILURE,
'message': __('Sorry, could not succesfully upload your file')
});
xhr.onerror();
}
}
};
......@@ -164,9 +161,14 @@
}
}, false);
xhr.onerror = () => {
let message = __('Sorry, could not succesfully upload your file.');
if (xhr.responseText) {
message += ' ' + __('Your server\'s response: "%1$s"', xhr.responseText)
}
this.save({
'type': 'error',
'upload': _converse.FAILURE,
'message': __('Sorry, could not succesfully upload your file')
'message': message
});
};
xhr.open('PUT', this.get('put'), true);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment