-
Notifications
You must be signed in to change notification settings - Fork 24
Closed
Labels
Description
The urllib2.urlopen() function may be throw the httplib.HTTPException (on python2.7) [1][2]. So i think that simplenote.py should handle the httplib.HTTPException.
[1] Full stack trace (Click to expand)
> /opt/nvpy/lib/python2.7/httplib.py(402)_read_status()
-> raise BadStatusLine("No status line received - the server has closed the connection")
(Pdb) bt
/home/yuuki/repo/github.com/cpbotha/nvpy/nvpy/debug.py(14)wrapper()
-> return fn(*args, **kwargs)
/home/yuuki/repo/github.com/cpbotha/nvpy/nvpy/notes_db.py(972)worker_sync()
-> result = self.update_note_to_server(o.note)
/home/yuuki/repo/github.com/cpbotha/nvpy/nvpy/notes_db.py(1012)update_note_to_server()
-> o, err = self.simplenote.update_note(note)
/home/yuuki/.local/lib/python2.7/site-packages/simplenote/simplenote.py(183)update_note()
-> response = urllib2.urlopen(request)
/opt/nvpy/lib/python2.7/urllib2.py(154)urlopen()
-> return opener.open(url, data, timeout)
/opt/nvpy/lib/python2.7/urllib2.py(429)open()
-> response = self._open(req, data)
/opt/nvpy/lib/python2.7/urllib2.py(447)_open()
-> '_open', req)
/opt/nvpy/lib/python2.7/urllib2.py(407)_call_chain()
-> result = func(*args)
/opt/nvpy/lib/python2.7/urllib2.py(1241)https_open()
-> context=self._context)
/opt/nvpy/lib/python2.7/urllib2.py(1201)do_open()
-> r = h.getresponse(buffering=True)
/opt/nvpy/lib/python2.7/httplib.py(1121)getresponse()
-> response.begin()
/opt/nvpy/lib/python2.7/httplib.py(438)begin()
-> version, status, reason = self._read_status()
> /opt/nvpy/lib/python2.7/httplib.py(402)_read_status()
-> raise BadStatusLine("No status line received - the server has closed the connection")
[2] Class hierarchy of the httplib.BadStatusLine (Click to expand)
$ python2
Python 2.7.15+ (default, Nov 28 2018, 16:27:22)
[GCC 8.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import httplib
>>> import inspect
>>> httplib.BadStatusLine
<class 'httplib.BadStatusLine'>
>>> inspect.getmro(httplib.BadStatusLine)
(<class 'httplib.BadStatusLine'>, <class 'httplib.HTTPException'>, <type 'exceptions.Exception'>, <type 'exceptions.BaseException'>, <type 'object'>)