daattali/shinycssloaders

More informative error message with wrong arguments

Closed this issue · 1 comments

Hi,

Thank you for the great work. I was using withSpinner and realised that sometimes we get an error message that may not immediately let us know what is going on, reprex next

shinycssloaders::withSpinner(
   
   br(),
  dataTableOutput("test")
 
 )

The above fails, rightly so, with

Error in shinycssloaders::withSpinner(br(), dataTableOutput("test")) :
type %in% 0:8 is not TRUE

I think it would be great if the error would specify for example that br was not an expected argument/input.

Thank you,

NelsonGon

In this case, br() is the first argument, so dataTableOutput() is actually the unexpected type argument.

I agree better error messages would be useful, feel free to submit a PR for this