rstudio / shiny

Easy interactive web applications with R
https://shiny.posit.co/
Other
5.37k stars 1.86k forks source link

Add helpful error message to shiny::need() #2509

Open chasemc opened 5 years ago

chasemc commented 5 years ago

Sorry not to issue a PR, but I'm currently super busy.

If label is left out of shiny::need(), the error message is not easy to figure out. It would be nice to include something like "label is missing in need()"

> shiny::need(1+1)
Error in paste(label, "must be provided") : 
  argument "label" is missing, with no default

Relevant line is here: https://github.com/rstudio/shiny/blob/e6c2133520e3f194e46aec2d545713ebde3a5fe9/R/utils.R#L1199

chasemc commented 5 years ago

Note: This might be good beginner/intermediate PR