-
Notifications
You must be signed in to change notification settings - Fork 15
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
Improve error with missing dataset DOI #51
Comments
Generally there are two ways of doing that in a special remote, assuming the problem is based on some exception (in that case a
try:
do_the_request()
except requests.exceptions.ConnectionError as exc:
# This will make sure the exception itself including its traceback, `__cause__`, `__context` is logged:
ce =CapturedException(exc)
# Form a proper user message.
# Note: `CapturedException` provides a couple of properties to reuse (parts of) the original exception.
self.message("Connection for purpose X failed due to {reason}".format(ce.message))
sys.exit(1) # Not sure if needed from the top of my head
try:
do_the_request()
except RequestException as exc:
# Note, that `RequestException` is more general
raise ValueError("New message to provide context to the user") from exc This will result in the an error message like |
Related to #48? I would opt for the second option |
Already done in #74 |
Current state:
The text was updated successfully, but these errors were encountered: