Lichen

Changeset

796:ea84f496b3f6
2017-04-03 Paul Boddie raw files shortlog changelog graph Added the string representation of the node at which a NodeProcessingError occurs to the string representation of the error.
errors.py (file)
     1.1 --- a/errors.py	Fri Mar 31 23:27:55 2017 +0200
     1.2 +++ b/errors.py	Mon Apr 03 00:12:47 2017 +0200
     1.3 @@ -70,7 +70,9 @@
     1.4  
     1.5      def __str__(self):
     1.6          lineno = self.get_lineno(self.astnode)
     1.7 -        return "Error in %s%s: %s" % (self.unit_name, lineno and (" at line %s" % lineno) or "", self.message)
     1.8 +        return "Error in %s%s: %s%s" % (
     1.9 +            self.unit_name, lineno and (" at line %s" % lineno) or "",
    1.10 +            self.message, self.astnode and "\n\n%s" % self.astnode or "")
    1.11  
    1.12  class InspectError(NodeProcessingError):
    1.13