mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-07-15 14:13:25 +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();
|
||||
} else {
|
||||
var msg = gettext('Error') + " " + xhr.status.toString() + ": " + Ext.htmlEncode(xhr.statusText);
|
||||
var result = Ext.decode(xhr.responseText);
|
||||
result.message = msg;
|
||||
var htmlStatus = Proxmox.Utils.extractRequestError(result, true);
|
||||
Ext.Msg.alert(gettext('Error'), htmlStatus, function(btn) {
|
||||
me.close();
|
||||
});
|
||||
|
||||
if (xhr.responseText !== "") {
|
||||
var result = Ext.decode(xhr.responseText);
|
||||
result.message = msg;
|
||||
var htmlStatus = Proxmox.Utils.extractRequestError(result, true);
|
||||
Ext.Msg.alert(gettext('Error'), htmlStatus, function(btn) {
|
||||
me.close();
|
||||
});
|
||||
} else {
|
||||
Ext.Msg.alert(gettext('Error'), msg, function(btn) {
|
||||
me.close();
|
||||
});
|
||||
}
|
||||
}
|
||||
}, false);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user