error: store filename and message on LookupError for later
authorMartin von Zweigbergk <martinvonz@google.com>
Wed, 04 Feb 2015 13:57:35 -0800
changeset 24038 10d02cd18604
parent 24037 f0b498cfc5c8
child 24039 2ee35b6ee4fb
error: store filename and message on LookupError for later It may be useful to be able to get to the failed path and the underlying error message when catching a LookupError, so let's make them accessible.
mercurial/error.py
--- a/mercurial/error.py	Wed Jan 14 16:14:19 2015 -0800
+++ b/mercurial/error.py	Wed Feb 04 13:57:35 2015 -0800
@@ -22,6 +22,8 @@
 class LookupError(RevlogError, KeyError):
     def __init__(self, name, index, message):
         self.name = name
+        self.index = index
+        self.message = message
         if isinstance(name, str) and len(name) == 20:
             from node import short
             name = short(name)