mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 01:22:13 -06:00
show toast with stack on rejected promises
This commit is contained in:
parent
0b52ccd200
commit
b65bea2550
|
@ -1524,6 +1524,7 @@ function autoplay_blocked(seek) {
|
||||||
go.textContent = 'Play "' + fn + '"';
|
go.textContent = 'Play "' + fn + '"';
|
||||||
go.onclick = function (e) {
|
go.onclick = function (e) {
|
||||||
unblocked(e);
|
unblocked(e);
|
||||||
|
toast.hide();
|
||||||
if (mp.au !== mp.au_ogvjs)
|
if (mp.au !== mp.au_ogvjs)
|
||||||
// chrome 91 may permanently taint on a failed play()
|
// chrome 91 may permanently taint on a failed play()
|
||||||
// depending on win10 settings or something? idk
|
// depending on win10 settings or something? idk
|
||||||
|
|
|
@ -30,7 +30,16 @@ function esc(txt) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
window.onunhandledrejection = function (e) {
|
window.onunhandledrejection = function (e) {
|
||||||
console.log("REJ: " + e.reason);
|
var err = e.reason;
|
||||||
|
try {
|
||||||
|
err += '\n' + e.reason.stack;
|
||||||
|
}
|
||||||
|
catch (e) { }
|
||||||
|
console.log("REJ: " + err);
|
||||||
|
try {
|
||||||
|
toast.warn(30, err);
|
||||||
|
}
|
||||||
|
catch (e) { }
|
||||||
};
|
};
|
||||||
try {
|
try {
|
||||||
console.hist = [];
|
console.hist = [];
|
||||||
|
|
Loading…
Reference in a new issue