cernopendata / cernopendata-client

CERN Open Data command-line client
http://cernopendata-client.readthedocs.io/
GNU General Public License v3.0
10 stars 9 forks source link

cernopendata-client get-metadata --recid 550 --output-value title #108

Closed tiborsimko closed 3 years ago

tiborsimko commented 3 years ago

Some records do not have files, and there is a traceback for various commands, e.g.

$ cernopendata-client get-metadata --recid 550 --output-value title
...
  File ".../cernopendata_client/searcher.py", line 157, in get_record_as_json
    if record_json["metadata"]["files"]:
KeyError: 'files'
$ cernopendata-client get-file-locations --recid 550
...
  File ".../cernopendata_client/searcher.py", line 157, in get_record_as_json
    if record_json["metadata"]["files"]:
KeyError: 'files'

We should: