Skip to content

Commit

Permalink
Add explicit exception for remove discourse
Browse files Browse the repository at this point in the history
  • Loading branch information
mmcauliffe committed Jul 17, 2019
1 parent 70ed648 commit 4959c32
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions polyglotdb/corpus/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,8 @@ def remove_discourse(self, name):
name : str
Name of the discourse to remove
"""
if name not in self.discourses:
raise GraphQueryError('{} is not a discourse in this corpus.'.format(name))
d = self.discourse_sound_file(name)
if d['consonant_file_path'] is not None and os.path.exists(d['consonant_file_path']):
directory = self.discourse_audio_directory(name)
Expand Down

0 comments on commit 4959c32

Please sign in to comment.