def decorator(func):

    @wraps(func)
    def wrapped(*args, **kwargs):
        try:
            return func(*args, **kwargs)
        except ClientHttpError as e:
            if (e.code == 404):
                raise DoesNotExist(msg)
            else:
                raise
    return wrapped
def decorator(func):

    @wraps(func)
    def wrapped(*args, **kwargs):
        try:
            return func(*args, **kwargs)
        except ClientHttpError as e:
            if (e.code == 404):
                raise DoesNotExist(msg)
            else:
                raise
    return wrapped