Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameterize error function #15

Closed
tonyfischetti opened this issue May 21, 2015 · 1 comment
Closed

Parameterize error function #15

tonyfischetti opened this issue May 21, 2015 · 1 comment

Comments

@tonyfischetti
Copy link
Owner

Right now assertr uses "stop" and a message to halt execution. I should allow the user to specify their own function that will be called when an assertion is violated.

For example, one could make a function that accepts the error string and emails the error message before calling stop

a generalized solution is to make a function that takes an email address and an error string, emails the error string to the email address and then halts execution. Then, a partially applied function can be used as the custom error function...

email.and error <- function(email, message){
  ...
}

mtcars %>% assert(is_set(c(1,0)), vs, on_error=partial(email.and.error("me@me.org")))
@tonyfischetti
Copy link
Owner Author

Almost done! Just need to update

  • version number
  • readme
  • news
  • vignette
  • roxegen doc to include new optional parameters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant