[Pas2js] page reload when server restarted not 100% reliable
Luca Olivetti
luca at ventoso.org
Mon Sep 22 18:44:31 CEST 2025
El 22/9/25 a les 18:33, Michael Van Canneyt ha escrit:
>> I'd like the exception to be propagated to the outer code so my
>> try..catch would work.
>
> Did you try putting the above in the load ?
>
> window.addEventListener("load", function () {
> if (typeof rtl === 'undefined' || typeof QRCode === 'undefined') {
> console.log('rtl o QRCode no definidos, recargo pagina');
> setTimeout(function() { location.reload(); }, 5000);
> } else {
> try {
> rtl.run();
> } catch(err) {
> console.log('error '+err.message+', recargo pagina');
> setTimeout(function() { location.reload(); }, 5000);
> }
> }
> });
Again, I'm not 100% sure but I think I tried everything at the time.
In any case in the scenario I described It shouldn't make a difference:
something is showing the exception instead of being propagated to my
try..catch block.
Bye
--
Luca
More information about the Pas2js
mailing list