bryanmikaelian/sifter-python — pull request #4 by zschmid (2014-03-27 01:53:57+00:00)
Title: Need to do exception handling in the event an issue doesnt have any comm...

Your library came in handy when trying to do a bulk export of sifter issues to JIRA. Thanks!

One scenario that I encountered that I patched up for you was in the event an issue doesn't have any comments. At first I thought of just doing a check on the comment_count from the Sifter issues API within my script, however I soon realized that the count it is returning are for 'true' comments. It also considers status changes, etc as comments.

This becomes problematic because at this point the comment.body doesn't exist and it throws a ValueError

Traceback for the error I encountered
```
Traceback (most recent call last):
File "jira.py", line 28, in
comments = issue.comments()
File "/sifter-python/issue.py", line 26, in comments
json_raw = self._account.request(self.api_url)
File "/sifter-python/account.py", line 18, in request
return json.loads(req.content)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 338, in loads
return _default_decoder.decode(s)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 365, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 383, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
```

The PR i'm including has a try statement which checks for a ValueError exception and if it occurs only returns the issue object