remove var operation error
This commit is contained in:
parent
ad0827c59c
commit
81abb1bbec
@ -435,21 +435,10 @@ class App(MiddlewareMixin, LifespanMixin, Base):
|
|||||||
TypeError: When an invalid component function is passed.
|
TypeError: When an invalid component function is passed.
|
||||||
exceptions.MatchTypeError: If the return types of match cases in rx.match are different.
|
exceptions.MatchTypeError: If the return types of match cases in rx.match are different.
|
||||||
"""
|
"""
|
||||||
from reflex.utils.exceptions import VarOperationTypeError
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return component if isinstance(component, Component) else component()
|
return component if isinstance(component, Component) else component()
|
||||||
except exceptions.MatchTypeError:
|
except exceptions.MatchTypeError:
|
||||||
raise
|
raise
|
||||||
except TypeError as e:
|
|
||||||
message = str(e)
|
|
||||||
if "Var" in message:
|
|
||||||
raise VarOperationTypeError(
|
|
||||||
"You may be trying to use an invalid Python function on a state var. "
|
|
||||||
"When referencing a var inside your render code, only limited var operations are supported. "
|
|
||||||
"See the var operation docs here: https://reflex.dev/docs/vars/var-operations/"
|
|
||||||
) from e
|
|
||||||
raise e
|
|
||||||
|
|
||||||
def add_page(
|
def add_page(
|
||||||
self,
|
self,
|
||||||
|
Loading…
Reference in New Issue
Block a user