code: def validate(retval, func, args):
      # type: (int, Any, Tuple[Any, Any]) -> Optional[Tuple[Any, Any]]
      
  
      if retval != 0 and not ERROR.details:
          return args
  
      err = "{}() failed".format(func.__name__)
      details = {"retval": retval, "args": args}
      raise ScreenShotError(err, details=details)
docs: Validate the returned value of a Xlib or XRANDR function.