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

refactor error-checking result #210

Closed
wibeasley opened this issue May 29, 2018 · 0 comments
Closed

refactor error-checking result #210

wibeasley opened this issue May 29, 2018 · 0 comments
Assignees

Comments

@wibeasley
Copy link
Member

There are several functions with code like this. Pull it out into a reusable & testable function

  regex_cannot_connect <- "^The hostname \\((.+)\\) / username \\((.+)\\) / password \\((.+)\\) combination could not connect.+"
  regex_empty <- "^\\s+$"

  if(
    any(grepl(regex_cannot_connect, raw_text)) |
    any(grepl(regex_empty, raw_text))
  ) {
    success <- FALSE
  }

Stepping back more, I now see how more could be included, starting with the httr::POST() call too. Someone (I think @nutterb) has been advocating this for at least year --I'm just now catching up.

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