mirror of
https://github.com/Textualize/textual-web.git
synced 2025-10-17 02:36:40 +03:00
capture forbidden errors
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
[account]
|
||||
|
||||
|
||||
[app.Calculator]
|
||||
path = "./"
|
||||
command = "python calculator.py"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from pathlib import Path
|
||||
import re
|
||||
@@ -87,6 +89,13 @@ class Form(Container):
|
||||
Form Input {
|
||||
border: tall transparent;
|
||||
}
|
||||
|
||||
Form Label.info {
|
||||
text-align: left;
|
||||
padding: 0 1 0 1;
|
||||
color: $warning 70%;
|
||||
}
|
||||
|
||||
"""
|
||||
|
||||
|
||||
@@ -185,6 +194,12 @@ class ErrorLabel(Label):
|
||||
|
||||
|
||||
class SignupScreen(Screen):
|
||||
@property
|
||||
def app(self) -> SignUpApp:
|
||||
app = super().app
|
||||
assert isinstance(app, SignUpApp)
|
||||
return app
|
||||
|
||||
def compose(self) -> ComposeResult:
|
||||
with Form():
|
||||
yield Label("Textual-web Signup", classes="title")
|
||||
@@ -196,8 +211,10 @@ class SignupScreen(Screen):
|
||||
|
||||
yield Label("Account slug*")
|
||||
with SignupInput(id="account_slug"):
|
||||
yield Input(placeholder="Identifier used in URLs")
|
||||
yield ErrorLabel()
|
||||
with Vertical(classes="group"):
|
||||
yield Input(placeholder="Identifier used in URLs")
|
||||
yield Label("First come, first serve (pick wisely)", classes="info")
|
||||
yield ErrorLabel()
|
||||
|
||||
yield Label("Email*")
|
||||
with SignupInput(id="email"):
|
||||
|
||||
@@ -10,6 +10,7 @@ from typing import TYPE_CHECKING, Union, cast
|
||||
|
||||
import aiohttp
|
||||
import msgpack
|
||||
from aiohttp.client_exceptions import WSServerHandshakeError
|
||||
|
||||
from . import constants, packets
|
||||
from .environment import Environment
|
||||
@@ -239,6 +240,9 @@ class GanglionClient(Handlers):
|
||||
break
|
||||
except asyncio.CancelledError:
|
||||
raise
|
||||
except WSServerHandshakeError:
|
||||
if retry_count == 1:
|
||||
log.warning("Received forbidden response, check your API Key")
|
||||
except Exception as error:
|
||||
if retry_count == 1:
|
||||
log.warning(
|
||||
|
||||
Reference in New Issue
Block a user