snitch3s/hackbunch

Better error handling

Closed this issue · 2 comments

I have added the support for username input.

Currently, it will throw an error if the username doesn't exist. Reproduce the steps and fix the issue by returning some warning message saying the username doesn't exist.

Steps to reproduce

  1. run the script.py in /scripts
  2. give a non-existent username as input

Error

Enter the GitHub username: vchrombir
Traceback (most recent call last):
  File "scripts/script.py", line 49, in <module>
    getpullRequests(username)
  File "scripts/script.py", line 35, in getpullRequests
    for pr in result['data']['repositoryOwner']['pullRequests']['nodes']:
TypeError: 'NoneType' object is not subscriptable

Can I take the lead?

@swainsubrat, thanks for asking.
I think @adiaux has started working on it already. So, please let me know if you want to work on this project. I can surely put up some other issues. 🙂