changeset 24038:10d02cd18604

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.
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 04 Feb 2015 13:57:35 -0800
parents f0b498cfc5c8
children 2ee35b6ee4fb
files mercurial/error.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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)