mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-07-15 21:29:28 +00:00
ui: storage: handle empty response in case of file upload error
Signed-off-by: Tim Marx <t.marx@proxmox.com>
This commit is contained in:
parent
792fdf4929
commit
abffa1a6dc
@ -290,13 +290,18 @@ Ext.define('PVE.storage.Upload', {
|
|||||||
me.close();
|
me.close();
|
||||||
} else {
|
} else {
|
||||||
var msg = gettext('Error') + " " + xhr.status.toString() + ": " + Ext.htmlEncode(xhr.statusText);
|
var msg = gettext('Error') + " " + xhr.status.toString() + ": " + Ext.htmlEncode(xhr.statusText);
|
||||||
|
if (xhr.responseText !== "") {
|
||||||
var result = Ext.decode(xhr.responseText);
|
var result = Ext.decode(xhr.responseText);
|
||||||
result.message = msg;
|
result.message = msg;
|
||||||
var htmlStatus = Proxmox.Utils.extractRequestError(result, true);
|
var htmlStatus = Proxmox.Utils.extractRequestError(result, true);
|
||||||
Ext.Msg.alert(gettext('Error'), htmlStatus, function(btn) {
|
Ext.Msg.alert(gettext('Error'), htmlStatus, function(btn) {
|
||||||
me.close();
|
me.close();
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
Ext.Msg.alert(gettext('Error'), msg, function(btn) {
|
||||||
|
me.close();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user