moviemon icon indicating copy to clipboard operation
moviemon copied to clipboard

Crash when tag not found

Open natzert opened this issue 8 years ago • 1 comments

Better error handling is required when a tag is not found.

Movies $ moviemon .


Indexing all movies inside  .


 58%|█████████████████████████████████████████████████████████████████████████████████████████████████▊                                                                      | 316/543 [01:53<01:46, 2.14B/s]
Traceback (most recent call last):
  File "/usr/local/bin/moviemon", line 9, in <module>
    load_entry_point('moviemon==1.0.11', 'console_scripts', 'moviemon')()
  File "/usr/local/lib/python2.7/dist-packages/moviemon/moviemon.py", line 61, in main
    util(args)
  File "/usr/local/lib/python2.7/dist-packages/moviemon/moviemon.py", line 77, in util
    scan_dir(docopt_args["PATH"], dir_json)
  File "/usr/local/lib/python2.7/dist-packages/moviemon/moviemon.py", line 281, in scan_dir
    data = get_movie_info(name)
  File "/usr/local/lib/python2.7/dist-packages/moviemon/moviemon.py", line 302, in get_movie_info
    return omdb(movie_info['title'], None)
KeyError: 'title'

natzert avatar Feb 23 '16 17:02 natzert

Firstly, sorry for such a delayed response. I realize that this is bug in my code itself, and honestly is a one line fix, but I think the legit way to go about this would be to have tests for the code so that we have a more authentic and stronger way of catching such errors. Currently, I don't have much time, but I'll work on this as soon as I find some time.

Thanks for reporting :)

iCHAIT avatar Mar 30 '16 17:03 iCHAIT