{"action":"opened","issue":{"url":"https://api.github.com/repos/stoduk/calibre_plugin_xray/issues/14","labels_url":"https://api.github.com/repos/stoduk/calibre_plugin_xray/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/stoduk/calibre_plugin_xray/issues/14/comments","events_url":"https://api.github.com/repos/stoduk/calibre_plugin_xray/issues/14/events","html_url":"https://github.com/stoduk/calibre_plugin_xray/issues/14","id":111957411,"number":14,"title":"Handle shelfari access problems more cleanly","user":{"login":"stoduk","id":5287714,"avatar_url":"https://avatars.githubusercontent.com/u/5287714?v=3","gravatar_id":"","url":"https://api.github.com/users/stoduk","html_url":"https://github.com/stoduk","followers_url":"https://api.github.com/users/stoduk/followers","following_url":"https://api.github.com/users/stoduk/following{/other_user}","gists_url":"https://api.github.com/users/stoduk/gists{/gist_id}","starred_url":"https://api.github.com/users/stoduk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stoduk/subscriptions","organizations_url":"https://api.github.com/users/stoduk/orgs","repos_url":"https://api.github.com/users/stoduk/repos","events_url":"https://api.github.com/users/stoduk/events{/privacy}","received_events_url":"https://api.github.com/users/stoduk/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/stoduk/calibre_plugin_xray/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-17T11:07:09Z","updated_at":"2015-10-17T11:07:09Z","closed_at":null,"body":"If the internet is flakey then urlopen fails and you get ugly tracebacks like that below.\r\n\r\nCould retry automatically, or just error with a more useful message.  [Shelfari seems to be struggling a little so retries aren't a bad idea; the .NET app retries 3 times FWIW]\r\n```\r\nGenerating XRay for A Christmas Carol\r\nLoading Shelfari from http://www.shelfari.com/books/4575254/A-Christmas-Carol...\r\n\r\nXRAY generation failed...\r\nTraceback (most recent call last):\r\n  File \"calibre_plugins.xray_generator.xrayaction\", line 214, in run\r\n  File \"calibre_plugins.xray_generator.xrayaction\", line 268, in _generate_xray\r\n  File \"calibre_plugins.xray_generator.xrayaction\", line 653, in readShelfari\r\n  File \"lib/python2.7/urllib2.py\", line 154, in urlopen\r\n  File \"lib/python2.7/urllib2.py\", line 431, in open\r\n  File \"lib/python2.7/urllib2.py\", line 449, in _open\r\n  File \"lib/python2.7/urllib2.py\", line 409, in _call_chain\r\n  File \"lib/python2.7/urllib2.py\", line 1227, in http_open\r\n  File \"lib/python2.7/urllib2.py\", line 1200, in do_open\r\n  File \"lib/python2.7/httplib.py\", line 1073, in getresponse\r\n  File \"lib/python2.7/httplib.py\", line 415, in begin\r\n  File \"lib/python2.7/httplib.py\", line 379, in _read_status\r\nBadStatusLine: ''\r\n```"}}