More informative error message from parse.value() for empty fields (e.g. include line number) #81

dlebauer opened this Issue Mar 13, 2012 · 3 comments


None yet

2 participants


This is a minor feature request to provide a useful error message returned from the parse.value function when a field is blank;

Current behavior:

an empty field, such as

##' @return 

results in the error:

Error: return requires a value in block <filename>.R:2

it would be more useful if the error message gave a line number, such as

Error: return requires a value in block <filename>.R:2 line:24


Error: ##` @return requires a value in block <filename>.R:2
hadley commented Mar 13, 2012

That :2 is the line number - unfortunately we can currently only locate the error to the start of the block, not the individual line.


would it be possible to specify the function and the empty field, e.g. the @return field is empty in myfunction() is empty
in the error message?

as an aside, I was surprised that a google query for "Error: return requires a value in block" had no results as a quoted string

hadley commented Sep 17, 2012

This should be more clear in roxygen3.

@hadley hadley closed this Sep 17, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment