code: def queue_exc(*arg, **kw):
      
      _self = arg[0]
      if not isinstance(_self, AnsibleUndefinedVariable):
          # Run for AnsibleUndefinedVariable instance
          return
      _rslt_q = None
      for stack_trace in inspect.stack():
          # Check if method to be skipped
          if stack_trace[3] in SKIP_METHODS:
              continue
          _frame = stack_trace[0]
          _locals = inspect.getargvalues(_frame).locals
          if 'self' not in _locals:
              continue
          # Check if current frame instance of worker
          if isinstance(_locals['self'], WorkerProcess):
              # Get queue to add exception
              _rslt_q = getattr(_locals['self'], '_rslt_q')
      if not _rslt_q:
          raise ValueError("No Queue found.")
      # Add interceptor exception
      _rslt_q.put(arg[3].message, interceptor=True)
docs: Queue undefined variable exception