Closed TAM360 closed 4 years ago
@TAM360 Do you think you have time in the next couple days to address the remaining comments? It looks like it's mostly fixing a typo and limiting the scope of the try/except block.
@showell yeah I do. I am gonna try to finish this by Sunday.
@TAM360 Can you rebase these commits into a single commit? We don't really want or need the merge commits or the commits that are just code-review fixes.
@showell I've already pushed 3-4 small commits to my branch. Will they get affected if I rebase my commits now and then push it?
@showell I've already pushed 3-4 small commits to my branch. Will they get affected if I rebase my commits now and then push it?
Yes, but that's the idea behind rebasing--I want you to replace those.
@showell all right.
From my previous comment:
We should have this block of code in the Client class, just before it returns the client object.
It looks like you've added the code to throw the error in multiple places; we only need it in the zulip Client's constructor.
@aero31aero I've added the validation logic in Client's constructor but as a result it's failing 4 of the unit test. Should I update those tests or add new ones?
@zulipbot abandon
ERROR: You have not claimed this issue to work on yet.
(I’m not sure this PR is still active, but it’s apparently still being referenced.)
"result": "error"
doesn’t necessarily imply that the credentials are wrong. We also need to check for HTTP status 401 or "code": "INVALID_API_KEY"
.
Also, sys.exit()
returns a successful exit code that’s inappropriate for an error condition. I think in most cases we just want to let the exception propagate up.
I am gonna close this since @TAM360 has abandoned it. @TAM360 Thanks for working on this!
Before sending any message to a user/stream via CLI, user's credentials are verified first. The idea is to update the users before they start using it (#533). This is done using validate_credentials() method which returns returns the result of get_profile API. The status of result is used to determine if the credentials are valid or not.