aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScorpil <scorpilmail@gmail.com>2012-07-20 00:42:43 +0300
committerScorpil <scorpilmail@gmail.com>2012-07-20 00:42:43 +0300
commita23f3d6143ca866bf990c71162e915c26b7c227e (patch)
treee7da60b292e966cb37e3a2dd5182ccee3dee1f96
parent773ba63ab957a698e6e7fd2a6c80c9901a281d63 (diff)
downloadmarkdown-a23f3d6143ca866bf990c71162e915c26b7c227e.tar.gz
markdown-a23f3d6143ca866bf990c71162e915c26b7c227e.tar.bz2
markdown-a23f3d6143ca866bf990c71162e915c26b7c227e.zip
Added more expressive description of an error.
-rw-r--r--markdown/odict.py6
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. """