code: def test_traceback_runtime_custom():
      class FooException(Exception):
          pass
  
      @eqx.filter_jit
      def f(x):
          return g(x)
  
      @eqx.filter_jit
      def g(x):
          def _raises():
              raise FooException("egads")
  
          return jax.pure_callback(_raises, x)  # pyright: ignore
  
      try:
          f(jnp.array(1.0))
      except Exception as e:
          # assert e.__cause__ is None  # varies by Python version and JAX version.
          assert "egads" in str(e)
          assert "EQX_ON_ERROR" not in str(e)
          tb = e.__traceback__
          code_stack = []
          while tb is not None:
              code_stack.append(tb.tb_frame.f_code)
              tb = tb.tb_next
          assert len(code_stack) == 4
          one, two, three, four = code_stack
          assert one.co_filename.endswith("test_errors.py")
          assert one.co_name == "test_traceback_runtime_custom"
          assert two.co_filename.endswith("equinox/_jit.py")
          assert two.co_name == "__call__"
          assert three.co_filename.endswith("equinox/_module.py")
          assert three.co_name == "__call__"
          assert four.co_filename.endswith("equinox/_jit.py")
          assert four.co_name == "_call"
  
file_path: equinox/tests/test_errors.py
imports: import equinox
  import equinox.internal
  import jax
  import jax.numpy
  import pytest
label_desc: Use image node_id 12 for calling a global function with example usage: test_traceback_runtime_custom() and returns: g, jax