Skip to content

more informative error for typo in "depends" list #292

@shainen

Description

@shainen

In the "depends" list in the "cache" function, when I put in a variable that does not exist (generally by accident), the error I get is
"Error in if (nrow(depends.hash) >= 1) { : argument is of length zero"

Unless you know the mistake you've made, its hard to tell from this error message that you've made a typo in the your "depends" variables. Would probably save some head scratching if the error was something more like
"Error, variable "x" in dependencies is not found in the current environment"

PS: Here is some code that will generate the error for me:
cache("new_var", {
x <- 56
}, depends = c("old_var"))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions