old_contents: from thinglang.utils.exception_utils import ThinglangException
  
  
  class VectorReductionError(ThinglangException):
      """
      A generic parser error, thrown when a vector of lexical tokens could not be
      entirely reduced - that is to say, invalid syntax was supplied by the user.
      """
  
  
  class InvalidIndexedAccess(ThinglangException):
      """
      Thrown when an invalid indexed access has been made.
      Examples:
          a[]
          a[1, 2, 3]
      """
  
new_contents: from typing import List
  
  from thinglang.utils.exception_utils import ThinglangException
  
  
  class VectorReductionError(ThinglangException):
      """
      A generic parser error, thrown when a vector of lexical tokens could not be
      entirely reduced - that is to say, invalid syntax was supplied by the user.
      """
  
      def __init__(self, reason: str, tokens: List):
          self.reason, self.tokens = reason, tokens
          super().__init__(str(self))
  
      def __str__(self):
          return f'{self.reason}: {self.tokens[0].source_ref}'
  
  
  class InvalidIndexedAccess(ThinglangException):
      """
      Thrown when an invalid indexed access has been made.
      Examples:
          a[]
          a[1, 2, 3]
      """
  
subject: Normalize exception message generation