code: def test_source_range_raise_exc(self):
      class FooTest5(torch.jit.ScriptModule):
          def __init__(self, val: int):
              super().__init__()
              self.val = val
  
          @torch.jit.script_method
          def add_method(self, val: int, x, w):
              if val == self.val:
                  raise RuntimeError("self.val and val are same")
              return x + w
  
          @torch.jit.script_method
          def forward(self, val: int, x, y, w):
              x = x * y
              x = x + 2
              return self.add_method(val, x, w)
  
      ft = FooTest5(42)
      loaded = self.getScriptExportImportCopy(ft)
      _, lineno = inspect.getsourcelines(FooTest5)
  
      try:
          loaded(
              42, torch.rand(3, 4), torch.rand(3, 4), torch.rand(30, 40)
          )
      except torch.jit.Error as e:
          error_message = f"{e}"
  
      # In C++ code, the type of exception thrown is torch::jit::JITException
      # which does not extend c10::Error, and hence it isn't possible to add
      # additional context to the exception message and preserve the correct
      #  C++ stack trace for symbolication. i.e. it isn't possible to add
      # the debug handle string to show where in the Python code the exception
      # occured w/o first changing
      # torch::jit::JITException to extend c10::Error.
      self.assertTrue("self.val and val are same" in error_message)
  
imports: import torch
  import torch.utils.bundled_inputs
  import io
  from tempfile import TemporaryFileName
  from typing import Dict, List
  import inspect
  from torch.testing import FileCheck
  from torch.jit.mobile import _load_for_lite_interpreter, _export_operator_list
  from torch.testing._internal.common_utils import TestCase, run_tests
  from torch.testing._internal.common_quantization import AnnotatedSingleLayerLinearModel, TwoLayerLinearModel, AnnotatedNestedModel
  from torch.testing._internal.common_quantization import QuantizationLiteTestCase
label_desc: Use image node_id 15 for calling the TestLiteScriptModule obj's underlying member method code with example usage: obj.test_source_range_raise_exc() and returns: unknown, self