You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code in bugwarrior/collect.py will yield the issue, which is to my knowledge always an Object, when there is a missing Attribute. To my knowledge, every instance where aggregate_issues (or some passed-down version of it) is iterated over needs a dictionary returned. Yielding an object creates a type error that is difficult to debug.
try:
yieldTaskConstructor(issue).get_taskwarrior_record()
exceptAttributeError:
ifisinstance(issue, tuple):
currently_running-=1completion_type, target=issueifcompletion_type==SERVICE_FINISHED_ERROR:
log.error(f"Aborted [{target}] due to critical error.")
yield ('SERVICE FAILED', target)
continueyieldissue
Please change the line "yield issue" to "raise".
The text was updated successfully, but these errors were encountered:
I agree that yielding the issue no longer makes sense here because the subsequent code expects either an issue dictionary or a tuple of information. However, I don't think we want to raise the error here because one badly behaving service shouldn't cause the others to fail too. I'm thinking that instead we should simply log the error rather than yield it -- so change yield issue to log.exception(f'AttributeError on {issue.config.target}'). What do you think?
After sleeping on this I'm thinking your original solution was correct. Any other kind of exception in the service would raise an uncaught exception here and we only happen to be catching AttributeError because that is how we detect our informational tuples. If it's not an informational tuple we should treat it like any other exception.
This code in bugwarrior/collect.py will yield the issue, which is to my knowledge always an Object, when there is a missing Attribute. To my knowledge, every instance where aggregate_issues (or some passed-down version of it) is iterated over needs a dictionary returned. Yielding an object creates a type error that is difficult to debug.
Please change the line "yield issue" to "raise".
The text was updated successfully, but these errors were encountered: