Pārlūkot izejas kodu

retain traceback of foreach untyped var error (#5052)

* retain traceback of foreach untyped var error

* dang it darglint
Khaleel Al-Adhami 1 mēnesi atpakaļ
vecāks
revīzija
7e3d68f99d
1 mainītis faili ar 4 papildinājumiem un 1 dzēšanām
  1. 4 1
      reflex/components/core/foreach.py

+ 4 - 1
reflex/components/core/foreach.py

@@ -55,6 +55,9 @@ class Foreach(Component):
             ForeachVarError: If the iterable is of type Any.
             ForeachVarError: If the iterable is of type Any.
             TypeError: If the render function is a ComponentState.
             TypeError: If the render function is a ComponentState.
             UntypedVarError: If the iterable is of type Any without a type annotation.
             UntypedVarError: If the iterable is of type Any without a type annotation.
+
+        # noqa: DAR401 with_traceback
+        # noqa: DAR402 UntypedVarError
         """
         """
         from reflex.vars import ArrayVar, ObjectVar, StringVar
         from reflex.vars import ArrayVar, ObjectVar, StringVar
 
 
@@ -107,7 +110,7 @@ class Foreach(Component):
                 iterable,
                 iterable,
                 "foreach",
                 "foreach",
                 "https://reflex.dev/docs/library/dynamic-rendering/foreach/",
                 "https://reflex.dev/docs/library/dynamic-rendering/foreach/",
-            ) from e
+            ).with_traceback(e.__traceback__) from None
         return component
         return component
 
 
     def _render(self) -> IterTag:
     def _render(self) -> IterTag: