code: def track_exception(self, type=None, value=None, tb=None, properties=None, measurements=None):
          
          if not type or not value or not tb:
              type, value, tb = sys.exc_info()
  
          if not type or not value or not tb:
              try:
                  raise Exception(NULL_CONSTANT_STRING)
              except:
                  type, value, tb = sys.exc_info()
  
          details = channel.contracts.ExceptionDetails()
          details.id = 1
          details.outer_id = 0
          details.type_name = type.__name__
          details.message = str(value)
          details.has_full_stack = True
          counter = 0
          for tb_frame_file, tb_frame_line, tb_frame_function, tb_frame_text in traceback.extract_tb(tb):
              frame = channel.contracts.StackFrame()
              frame.assembly = 'Unknown'
              frame.file_name = tb_frame_file
              frame.level = counter
              frame.line = tb_frame_line
              frame.method = tb_frame_function
              details.parsed_stack.append(frame)
              counter += 1
          details.parsed_stack.reverse()
  
          data = channel.contracts.ExceptionData()
          data.handled_at = 'UserCode'
          data.exceptions.append(details)
          if properties:
              data.properties = properties
          if measurements:
              data.measurements = measurements
          self.track(data, self._context)
docs: Send information about a single exception that occurred in the application.
  
          Args:
              type (Type). the type of the exception that was thrown.\n
              value (:class:`Exception`). the exception that the client wants to send.\n
              tb (:class:`Traceback`). the traceback information as returned by :func:`sys.exc_info`.\n
              properties (dict). the set of custom properties the client wants attached to this data item. (defaults to: None)\n
              measurements (dict). the set of custom measurements the client wants to attach to this data item. (defaults to: None)