-
Notifications
You must be signed in to change notification settings - Fork 38
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
Add GlobusSDKUsageError & replace most ValueErrors #281
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
import os | ||
|
||
from globus_sdk.exc import GlobusSDKUsageError | ||
|
||
|
||
def _on_windows(): | ||
""" | ||
|
@@ -49,7 +51,7 @@ def endpoint_id(self): | |
if _on_windows(): | ||
appdata = os.getenv("LOCALAPPDATA") | ||
if appdata is None: | ||
raise ValueError( | ||
raise GlobusSDKUsageError( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the absence of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was considering it a usage error from the start because it's not okay to try to use this method after clearing I doubt this will ever get tripped, but #robustnessprinciple Anyway, it sounds like you're okay with this error as it is in this PR. |
||
"LOCALAPPDATA not detected in Windows environment") | ||
fname = os.path.join( | ||
appdata, "Globus Connect\client-id.txt") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need to introduce this new error class in
docs/exceptions.rst
as well, including maybe rephrasing the "malformed calls to Globus SDK methods may raise standard python exceptions" bit?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think a doc update would be appropriate. Will add.