J535D165 / datahugger

One downloader for many scientific data and code repositories! DOI :open_hands: Data
https://J535D165.github.io/datahugger/
MIT License
65 stars 10 forks source link

Change ValueError into RepositoryNotSupportedError #62

Closed J535D165 closed 1 year ago

J535D165 commented 1 year ago

This PR introduces a new error for not supported repositories. This change might be breaking when you catch the ValueError for "Data protocol not found".

import datahugger

try:
    datahugger.get("my_doi", "data")
except datahugger.RepositoryNotSupportedError:
    print("Datahugger doesn't support this resource")
except Exception:
   print("Unexpected error")