Conversation
mat-lord
reviewed
Jul 22, 2020
Contributor
mat-lord
left a comment
There was a problem hiding this comment.
What are these examples for? Are they to display what exceptions can be raised? If so, we can do the following instead:
import staxapp.exceptions
for key, value in sorted(staxapp.exceptions.__dict__.items()):
if isinstance(value, type):
print(key)Which returns this:
ApiException
InvalidCredentialsException
JSONDecodeError
ValidationException
|
Can we please keep them as they are? I like that it's clear an explicit as to the error types that are available, and that are being caught in each example. |
rowanu
reviewed
Jul 27, 2020
| except ApiException as e: | ||
| print(e) | ||
| if e.status_code == 404: | ||
| print("No accounts exist") |
There was a problem hiding this comment.
Is "No accounts exist" the right text here?
Seems strange to get that back from a ReadCatalogueItems() call?
Contributor
Author
There was a problem hiding this comment.
I've done this change
43c3c6b to
12c2ad7
Compare
12c2ad7 to
8be714b
Compare
Codecov Report
@@ Coverage Diff @@
## master #54 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 7 7
Lines 323 323
=========================================
Hits 323 323 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Examples for each of the exceptions
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
What is the current behavior? (You can also link to an open issue here)
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)