<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def validate(retval, func, args):
 # type: (int, Any, Tuple[Any, Any]) -> Optional[Tuple[Any, Any]] """ Validate the returned value of a Xlib or XRANDR function. """


    if retval != 0 and not ERROR.details:
        return args

    err = "{}() failed".format(func.__name__)
    details = {"retval": retval, "args": args}
    raise ScreenShotError(err, details=details)