diff options
-rw-r--r-- | markdown/odict.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/markdown/odict.py b/markdown/odict.py index d545a46..d77d701 100644 --- a/markdown/odict.py +++ b/markdown/odict.py @@ -117,7 +117,10 @@ 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 ValueError("Element '%s' was not found in OrderedDict" % key) def index_for_location(self, location): """ Return index or None for a given location. """ |