Skip to content

Commit

Permalink
raise a ValueError if database name not recognized (mispelled or not …
Browse files Browse the repository at this point in the history
…implemented yet)
  • Loading branch information
lb803 committed Aug 17, 2022
1 parent f72f01b commit a351b6c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,11 @@ class Metadata:
def __init__(self, database="thoth", doi=None):
if database == "thoth":
self.db = Thoth(doi)
if database == "crossref":
elif database == "crossref":
self.db = Crossref(doi)
else:
raise ValueError(f"Database '{database}' misspelled or not "
"implemented yet.")

self.book = self.fetch_book_data()
self.chapters = self.fetch_chapter_data()
Expand Down

0 comments on commit a351b6c

Please sign in to comment.