This decorator must return the error_func for it to work