mirror of
https://github.com/9001/copyparty.git
synced 2025-11-04 22:03:21 +00:00
xhrchk: generic error only as fallback
This commit is contained in:
@@ -2298,9 +2298,6 @@ function xhrchk(xhr, prefix, e404, lvl, tag) {
|
|||||||
if (xhr.status == 404)
|
if (xhr.status == 404)
|
||||||
return toast.err(0, prefix + e404 + suf, tag);
|
return toast.err(0, prefix + e404 + suf, tag);
|
||||||
|
|
||||||
if (XC_CMSG[xhr.status])
|
|
||||||
errtxt = XC_CMSG[xhr.status];
|
|
||||||
|
|
||||||
if (!xhr.status && !errtxt)
|
if (!xhr.status && !errtxt)
|
||||||
return toast.err(0, prefix + L.xhr0);
|
return toast.err(0, prefix + L.xhr0);
|
||||||
|
|
||||||
@@ -2319,5 +2316,8 @@ function xhrchk(xhr, prefix, e404, lvl, tag) {
|
|||||||
document.body.appendChild(fr);
|
document.body.appendChild(fr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (XC_CMSG[xhr.status] && (errtxt.indexOf('<html') + 1))
|
||||||
|
errtxt = XC_CMSG[xhr.status];
|
||||||
|
|
||||||
return fun(0, prefix + xhr.status + ": " + errtxt, tag);
|
return fun(0, prefix + xhr.status + ": " + errtxt, tag);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user