diff options
author | Scorpil <scorpilmail@gmail.com> | 2012-07-20 00:42:43 +0300 |
---|---|---|
committer | Scorpil <scorpilmail@gmail.com> | 2012-07-20 00:42:43 +0300 |
commit | a23f3d6143ca866bf990c71162e915c26b7c227e (patch) | |
tree | e7da60b292e966cb37e3a2dd5182ccee3dee1f96 | |
parent | 773ba63ab957a698e6e7fd2a6c80c9901a281d63 (diff) | |
download | markdown-a23f3d6143ca866bf990c71162e915c26b7c227e.tar.gz markdown-a23f3d6143ca866bf990c71162e915c26b7c227e.tar.bz2 markdown-a23f3d6143ca866bf990c71162e915c26b7c227e.zip |
Added more expressive description of an error.
-rw-r--r-- | markdown/odict.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/markdown/odict.py b/markdown/odict.py index d545a46..2beabaa 100644 --- a/markdown/odict.py +++ b/markdown/odict.py @@ -117,7 +117,11 @@ class OrderedDict(dict): def index(self, key): """ Return the index of a given key. """ - return self.keyOrder.index(key) + try: + return self.keyOrder.index(key) + except ValueError, e: + raise KeyError("Element '%s' was not found in OrderedDict") + def index_for_location(self, location): """ Return index or None for a given location. """ |