Skip to content

Make settings fun again - including loud but intelligible yelling if something is missing #16

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

Closed
florianm opened this issue Aug 28, 2019 · 1 comment
Assignees
Milestone

Comments

@florianm
Copy link
Collaborator

florianm commented Aug 28, 2019

Feature

All functions using settings should fail with a meaningful error message.

Source ropensci/software-review#335 @maelle

The current error messages are not informative in the absence of credentials, 
i.e. I get Error in curl::curl_fetch_memory(url, handle = handle) : <url> malformed 
if I run project_list() now without credentials. 
If there's no system variables set and no credentials passed either, 
the functions should fail with an informative error message.
@florianm florianm added this to the rOpenSci milestone Aug 28, 2019
@florianm florianm self-assigned this Aug 28, 2019
@florianm
Copy link
Collaborator Author

It's probably time to bite the ckanr_setup/ckanr_settings apple I've avoided so far:

  • get_odkc_{test_}{url, un, pw}() to wrap Sys.getenv("ODKC_{TEST_}{URL, UN,PW}") as standard args for functions, e.g. project_list(url = get_odkc_url(), un = get_odkc_un(), ...)
  • ruODK_setup(url="xxx", un="yyy", pw="zzz", test_url="...", test_un="...", test_pw="...") to wrap Sys.setenv(ODKC_{TEST_}{URL, UN, PW})
    That would be an opportunity to make ruODK yell loudly but clearly about missing credentials.

@florianm florianm changed the title Include meaningful error message on missing settings including credentials Make settings fun again - including loud bit intelligible yelling if missing Aug 29, 2019
@florianm florianm changed the title Make settings fun again - including loud bit intelligible yelling if missing Make settings fun again - including loud but intelligible yelling if something is missing Aug 29, 2019
florianm pushed a commit that referenced this issue Aug 29, 2019
Add getters and setter for settings, tests, docs.
Convert project_* and related tests to use settings getters as defaults.
TODO convert remaining functions.
florianm pushed a commit that referenced this issue Aug 29, 2019
Add getters and setter for settings, tests, docs.
Convert project_* and related tests to use settings getters as defaults.
TODO convert remaining functions.
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