This bug has been reported by @david.wylie more than two years ago and has not been fixed.
I’m pretty sure if there was any security concern the Anvil team would have fixed it immediately.
This is just a bad management on the client side of a good exception coming from the server.
I just realized this is handled correctly in the IDE (at least the old one, I don’t use the beta), but when I open the app in a new browser window I can reproduce the “H” redbox by doing raise anvil.server.SessionExpiredError
It now correctly displays the correct timed out error alert box, however it still has the red error box with “H” in it.
Is this the desired behaviour?
Here is the only code in the app, using one button and material design:
(mostly copied from the docs)
def primary_color_1_click(self, **event_args):
try:
raise anvil.server.SessionExpiredError
except anvil.server.SessionExpiredError:
#anvil.server.reset_session()
# This will work now, but with a blank session
#anvil.server.call("foo")
print("foo")
raise
Edit: oh also i had to import anvil to access the exception class.