You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Guys!
I'm using try/except to validate content in text fields. such as if the field is empty or if the date is correct.
However, to force the flet to stay within this try/except and not continue executing the script, I am using quit() or exit() at the end of the except clause. See the example below:
The problem is that an exception error occurs in the program because of the quit()...
I want to continue using try/except, but eliminating the exception message
Any idea?
Code sample
cli_name=ft.TextField(label="Nome do cliente",bgcolor=ft.colors.BLUE_100,max_length=30,
text_style=ft.TextStyle(size=15,color=ft.colors.GREY_700,weight="BOLD",font_family='Tahoma'),dense=True)
try:
iflen(nome)==0:
raiseValueError('Nome Deve Ser Cadastrado')
exceptValueErroraserro:
cli_name.error_text=erropg.page.update()
exit()
Error message
"During handling of the above exception, another exception occurred:""quit() File "<frozen _sitebuiltins>", line 26, in __call__SystemExit: None"
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Question
Hi Guys!
I'm using try/except to validate content in text fields. such as if the field is empty or if the date is correct.
However, to force the flet to stay within this try/except and not continue executing the script, I am using quit() or exit() at the end of the except clause. See the example below:
The problem is that an exception error occurs in the program because of the quit()...
I want to continue using try/except, but eliminating the exception message
Any idea?
Code sample
Error message
------------------------------------------------------
Beta Was this translation helpful? Give feedback.
All reactions