Skip to content
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 Exception Handling #8

Open
VickiLanger opened this issue Jan 27, 2020 · 10 comments
Open

Add Exception Handling #8

VickiLanger opened this issue Jan 27, 2020 · 10 comments
Assignees
Labels
bug Something isn't working Hacktoberfest Requesting input/assistance

Comments

@VickiLanger
Copy link
Owner

VickiLanger commented Jan 27, 2020

Need to add exception handling to tweet.py

try:
    api.update_status(question)
except:
    # not sure what would go here?
finally:
    api.update_status('I seem to not be working properly. Bug @Vicki_Langer about getting me fixed or help her out by submitting a pull request https://github.com/VickiLanger/code-questions-bot')

Don't forget to follow the bot on Twitter to see the hard work you put in.

@VickiLanger VickiLanger self-assigned this Jan 27, 2020
@VickiLanger VickiLanger removed their assignment Oct 1, 2020
@VickiLanger VickiLanger added Hacktoberfest Requesting input/assistance bug Something isn't working labels Oct 1, 2020
@sroy8091
Copy link

sroy8091 commented Oct 1, 2020

@VickiLanger we can send a report email in case of exception, and keep on restarting the server after a configurable amount of time.

@VickiLanger
Copy link
Owner Author

@sroy8091 Yes, an email would work. That makes sense. I don't see why we couldn't restart the server until it works.

@achoudh5
Copy link
Contributor

achoudh5 commented Oct 4, 2020

@VickiLanger can we put the specific status code under except part?

Reference

@VickiLanger
Copy link
Owner Author

@achoudh5 that seems like it would make sense. Honestly, I have not done any exception handling outside of some practice. So, I'm not sure what it normally looks like.

@achoudh5
Copy link
Contributor

achoudh5 commented Oct 4, 2020

If I may ask, what I understood by tweet.py and this error handling case is that after making sure the user enters their credentials right, it's taking some questions from a pool of questions and putting them as tweet right?

@VickiLanger
Copy link
Owner Author

Yes. tweet.py uses questions from files in questions_dir

@achoudh5
Copy link
Contributor

achoudh5 commented Oct 4, 2020

Awesome! so, can we use an edge case file like if a user sends an empty tweet or some tweets they wants to avoid but since it's automated they don't have any control over it?

@VickiLanger
Copy link
Owner Author

Yes. That makes sense. An empty tweet definitely shouldn't happen.

@achoudh5
Copy link
Contributor

achoudh5 commented Oct 4, 2020

Is that the only case you want to consider for now? I can create a PR for that if it's fine

@VickiLanger
Copy link
Owner Author

That's the only thing I can think of. Go for it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Hacktoberfest Requesting input/assistance
Projects
None yet
Development

No branches or pull requests

3 participants