-
Notifications
You must be signed in to change notification settings - Fork 2
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
Reduce the prevalence of None
as a return value
#178
Conversation
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.
Some minor tweaks to apply, but I want to hold off on approving and merging until after we do a release.
Although we're now fairly certain that this won't cause impactful changes for known AP Tools users, I think including it in the next release would not match some of the messages I've sent to other teams about what to expect out of our next two releases.
``InactiveTokenError`` is a subclass of ``ValueError``. | ||
|
||
Existing code that calls ``AuthState.introspect_token()`` no longer returns ``None``, either, | ||
but will instead raise ``ValueError``, a subclass of ``ValueError``, |
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.
Gotcha! This is why they pay me the looks at his bank balance ... does that count as "big bucks"? 😛
but will instead raise ``ValueError``, a subclass of ``ValueError``, | |
but will instead raise ``ValueError``, |
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.
InactiveTokenError
and InvalidTokenScopesError
are subclasses of ValueError
...?
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.
Right, but the text says that ValueError
is a subclass of ValueError
, unless I'm very confused. (And if I am, I'll count that as a request for a rephrase!)
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.
Oh! I see now. It's a list of options, of length 3,
ValueError
- a subclass of
ValueError
globus_sdk.GlobusAPIError
I thought it was a list of length 2,
ValueError
, a subclass ofValueError
globus_sdk.GlobusAPIError
Can we scratch "a subclass of ValueError
" from the list, but now on different grounds, which is that it's unnecessary to specify?
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.
One last alternate:
ValueError
(or a subclass) orglobus_sdk.GlobusAPIError
?
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.
My approval should speak for itself.
But since it doesn't seem to speak up, "yes!" and "w00t!" and other exclamations of joy. I now understand the text and it says everything you wanted it to say!
Co-authored-by: Stephen Rosen <1300022+sirosen@users.noreply.github.com>
c5c5f4d
to
a311113
Compare
Supersedes #152
Changes
AuthState.introspect_token()
will no longer returnNone
if the token is not active.Instead, a new exception,
InactiveTokenError
, will be raised.InactiveTokenError
is a subclass ofValueError
.Existing code that calls
AuthState.introspect_token()
no longer returnsNone
, either,but will instead raise
ValueError
, a subclass ofValueError
,or a
globus_sdk.GlobusAPIError
:AuthState.get_authorizer_for_scope
AuthState.effective_identity
AuthState.identities