simplenote-vim / simplenote.vim

vim plugin to interact with the simplenote service
http://www.vim.org/scripts/script.php?script_id=3582
MIT License
368 stars 31 forks source link

No error handling on `SimplenoteOpen` #104

Closed m1foley closed 5 years ago

m1foley commented 5 years ago

I get the following error when I call :SimplenoteOpen with an invalid note key:

Error detected while processing function simplenote#SimplenoteOpen:
line    4:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/mike/.vim/plugged/simplenote.vim/autoload/SimplenoteOpen.py", line 6, in <modul
e>
    SimplenoteOpen()
  File "/Users/mike/.vim/plugged/simplenote.vim/autoload/SimplenoteOpen.py", line 2, in Simple
noteOpen
    interface.display_note_in_scratch_buffer(vim.eval("a:noteid"))
  File "/Users/mike/.vim/plugged/simplenote.vim/autoload/SimplenoteUtilities.py", line 310, in
 display_note_in_scratch_buffer
    firstline = regex.sub("_", note["content"].split("\n")[0])
TypeError: 'HTTPError' object is not subscriptable

FWIW, I tried to use it like :SimplenoteOpen Todo before I read the documentation. Even simple error handling ("notekey not found") would help with discoverability.

atomicules commented 5 years ago

Sounds like a reasonable request. Will add to my todo list.