pharmaverse/datacutr

Feature Request: More verbose/detailed error message when `cut_date` is fed into `create_dcut` incorrectly

Opened this issue · 1 comments

Feature Idea

I recently ran the following code

dcut <- create_dcut(
  dataset_ds = source_data$ds ,
  ds_date_var = DSSTDTC,
  filter = DSDECOD == "RANDOMIZED",
  cut_date = cut_date,
  cut_description = "Clinical Cutoff Date"
)

where cut_date had been generated wrong upstream and so was NULL. Thus the function errored, but the message was:

Error: assert_that: length of assertion is not 1

when I would have like something along the lines of:

Error: `cut_date` is of class NULL instead of class Date

Relevant Input

No response

Relevant Output

No response

Reproducible Example/Pseudo Code

No response

This should get resolved with #187.
FYI @reesnj @barnett11