grahamrow / zim-mendeley-plugin

Plugin for inserting citations into Zim
GNU General Public License v2.0
9 stars 1 forks source link

[BugReport] error pop up when "generate mendeley bibliography" #1

Closed nirvana6 closed 9 years ago

nirvana6 commented 9 years ago
This is zim 0.62
Platform: posix
Locale: en_US UTF-8
FS encoding: UTF-8
Python: (2, 7, 6, 'final', 0)
Gtk: (2, 24, 23)
Pygtk: (2, 24, 0)
No bzr version-info found

======= Traceback =======
  File "/usr/lib/pymodules/python2.7/zim/actions.py", line 55, in func
    self.func(instance, *arg, **kwarg)
  File "/usr/lib/pymodules/python2.7/zim/plugins/zim-mendeley-plugin/__init__.py", line 192, in generate_mendeley_bibliography
    self.plugin.render_bibliography(self.get_mendeley_uuids(), buffer)
  File "/usr/lib/pymodules/python2.7/zim/plugins/zim-mendeley-plugin/__init__.py", line 145, in render_bibliography
    citation = api.getFieldCodeFromUuid("{"+uuid+"}")
  File "/usr/lib/pymodules/python2.7/zim/plugins/zim-mendeley-plugin/MendeleyDesktopAPI.py", line 219, in getFieldCodeFromUuid
    raise MendeleyHttpClient.UnexpectedResponse(response)
UnexpectedResponse: status: 404, body: {"error": "Document with UUID {+\u79d1\u5b66\u7814\u7a76\u7684\u65b9\u6cd5\u8bba} doesn't exist"}

In fact, there are other linked page with the same zim page( with zim syntax "+some relative page"). so, when generate mendeley bibliography, the zim-mendeley plugins doesn't deal with the "+ some relative page" properly.

grahamrow commented 9 years ago

Added a quick check to ensure that the links actually contain "mendeley://" or "http://dx.doi.org" before attempting to generate the bibliography. Sorry for the wait :)