sir-lancebot
sir-lancebot copied to clipboard
KeyError: 'draft'
Sentry Issue: SIR-LANCEBOT-6X
KeyError: 'draft'
File "discord/ext/commands/core.py", line 167, in wrapped
ret = await coro(*args, **kwargs)
File "bot/exts/utilities/issues.py", line 211, in issue
results = [await self.fetch_issues(number, repository, user) for number in numbers]
File "bot/exts/utilities/issues.py", line 211, in <listcomp>
results = [await self.fetch_issues(number, repository, user) for number in numbers]
File "bot/exts/utilities/issues.py", line 142, in fetch_issues
if pull_data["draft"]:
Unhandled command error: 'draft'
Can someone supply more details about this? I don't have authorization to view the issue in Sentry. It would be helpful to have a steps-to-reproduce or something similar. Thanks!
Can someone supply more details about this? I don't have authorization to view the issue in Sentry. It would be helpful to have a steps-to-reproduce or something similar. Thanks!
Looking at the error, it mentions File "bot/exts/utilities/issues.py", line 142, in fetch_issues.
That leads me to this line https://github.com/python-discord/sir-lancebot/blob/main/bot/exts/utilities/issues.py#L142
So it seems pull_data here is the response from GitHub converted to a dict using .json().
Since this is a KeyError, this suggests that the response from GitHub's API doesn't always return a draft key, so we should handle that.
There really isn’t much else to this. The command ran was pr 919, which does not currently produce an error. The original triggering message has been deleted, but it doesn’t add any useful context here.
I can only assume the API returned something unexpected, so let’s just add a check for that.
@ChrisLovering Thank you! Could you assign me and @evgriff to this?
@ChrisLovering Thank you! Could you assign me and @evgriff to this?
I've assigned you to the issue. I can't assign the other person, as I can only assign people who have commented.
this would be fixed as part of #968, if not fixed as part of #778 (which is waiting on one approval)
I believe this has been resolved with #778, closing.
I believe this has been resolved with https://github.com/python-discord/sir-lancebot/pull/778, closing.
This was not fixed with #778. https://github.com/python-discord/sir-lancebot/blob/657aaf5f613b0bd219d67c71f7dc37ede0bb6aab/bot/exts/utilities/githubinfo.py#L129-L130
I believe this has been resolved with #778, closing.
This was not fixed with #778.
https://github.com/python-discord/sir-lancebot/blob/657aaf5f613b0bd219d67c71f7dc37ede0bb6aab/bot/exts/utilities/githubinfo.py#L129-L130
@HassanAbouelela