(func: Callable)
return wrapper
Wrapper function for s3 requests in order to create more helpful error
    messages.
Wrapper function for s3 requests in order to create more helpful error
    messages.
Wrapper function for s3 requests in order to create more helpful error messages .
def s3_request(func: Callable):
    """
    Wrapper function for s3 requests in order to create more helpful error
    messages.
    """

    @wraps(func)
    def wrapper(url: str, *args, **kwargs):
        try:
            return func(url, *args, **kwargs)
        except ClientError as exc:
            if int(exc.response["Error"]["Code"]) == 404:
                raise FileNotFoundError("file {} not found".format(url))
            else:
                raise

    return wrapper
def s3_request ( func : Callable ) : @ wraps ( func ) def wrapper ( url : str , * args , * * kwargs ) : try : return func ( url , * args , * * kwargs ) except ClientError as exc : if int ( exc . response [ "Error" ] [ "Code" ] ) == 404 : raise FileNotFoundError ( "file {} not found" . format ( url ) ) else : raise return wrapper