Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' of /~https://github.com/allenai/allennlp
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkgr committed Apr 16, 2020
2 parents 25ed047 + 25ba3a2 commit 3ead054
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion allennlp/common/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,10 @@ def pop(self, key: str, default: Any = DEFAULT, keep_as_dict: bool = False) -> A
try:
value = self.params.pop(key)
except KeyError:
raise ConfigurationError(f'key "{key}" is required at location "{self.history}"')
msg = f'key "{key}" is required'
if self.history:
msg += f' at location "{self.history}"'
raise ConfigurationError(msg)
else:
value = self.params.pop(key, default)

Expand Down

0 comments on commit 3ead054

Please sign in to comment.