Decorator/wrapper function to force return None instead of raising module exceptions.

    Exceptions that can be ignored are found in mypolr.exceptions.

def no_raise(f):
    """Decorator/wrapper function to force return None instead of raising module exceptions.

    Exceptions that can be ignored are found in mypolr.exceptions."""
    @wraps(f)
    def new_f(*args, **kwargs):
        try:
            return f(*args, **kwargs)
        except MypolrError:
            pass
        return None
    return new_f