[Roxygen-devel] [roxygen2] More explicit error messages?
Hadley Wickham
hadley at rice.edu
Wed Sep 21 18:18:58 CEST 2011
On Wed, Sep 21, 2011 at 11:10 AM, Renaud Gaujoux <renaud at cbio.uct.ac.za> wrote:
> It was very straightforward indeed.
> Patching line 324 of roclet-rd.R with the following seems to do the trick:
>
> if (is.null(name)){
> # get the location and filename from srcref
> ll <- partitum$srcref$lloc
> stop("Missing name in block ", basename(partitum$srcref$filename),
> ":lines ", ll[1], "-", ll[3])
> }
>
> More verbose error messages for other types of errors (e.g. related to wrong
> usage of roxygen flags) would still be nice to have as well, but this at
> least allows to pinpoint very problematic blocks.
It would be even better to pull that out into a separate function:
roxygen_stop <- function(msg, srcref) {
ll <-srcref$lloc
stop(msg, "\n", "In: ", basename(srcref$filename), ":lines ",
ll[1], "-", ll[3])
}
then replace all uses of stop (and similarly for warning).
A patch along those lines would be greatly appreciated!
> This brought me to another question (which might need a separate post
> though): it seems that union class names are not extracted (throws the
> error: Missing name).
You'll need to provide more details on that one.
Hadley
--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/
More information about the Roxygen-devel
mailing list