daattali / shinycssloaders

⌛ Add loading animations to a Shiny output while it's recalculating
https://daattali.com/shiny/shinycssloaders-demo/
Other
395 stars 45 forks source link

More informative error message with wrong arguments #69

Closed Nelson-Gon closed 1 year ago

Nelson-Gon commented 2 years ago

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

daattali commented 2 years ago

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