Commit 849b37a1 authored by Dietmar Maurer's avatar Dietmar Maurer

display correct error message on file uploads

parent cb39891f
...@@ -269,15 +269,18 @@ Ext.define('PVE.storage.Upload', { ...@@ -269,15 +269,18 @@ Ext.define('PVE.storage.Upload', {
me.close(); me.close();
} else { } else {
var msg = "Error " + xhr.status.toString() + ": " + Ext.htmlEncode(xhr.statusText); var msg = "Error " + xhr.status.toString() + ": " + Ext.htmlEncode(xhr.statusText);
Ext.Msg.alert(gettext('Error'), msg, function(btn) { var result = Ext.decode(xhr.responseText);
result.message = msg;
var htmlStatus = PVE.Utils.extractRequestError(result, true);
Ext.Msg.alert(gettext('Error'), htmlStatus, function(btn) {
me.close(); me.close();
}); });
} }
}, false); }, false);
xhr.addEventListener("error", function(e) { xhr.addEventListener("error", function(e) {
var msg = "Error " + e.target.status.toString() + " occurred while receiving the document."; var msg = "Error " + e.target.status.toString() + " occurred while receiving the document.";
Ext.Msg.alert(gettext('Error'), msg, function(btn) { Ext.Msg.alert(gettext('Error'), msg, function(btn) {
me.close(); me.close();
}); });
......
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