/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-04-26 02:19:42 UTC
  • mfrom: (2456.1.1 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20070426021942-eutaiob3qgh6kln8
(robertc) Use repr rather than str when reporting an unprintable exception to aid debugging. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
102
102
                    return s.encode('utf8')
103
103
                return s
104
104
        except (AttributeError, TypeError, NameError, ValueError, KeyError), e:
105
 
            return 'Unprintable exception %s: dict=%r, fmt=%r, error=%s' \
 
105
            return 'Unprintable exception %s: dict=%r, fmt=%r, error=%r' \
106
106
                % (self.__class__.__name__,
107
107
                   self.__dict__,
108
108
                   getattr(self, '_fmt', None),
109
 
                   str(e))
 
109
                   e)
110
110
 
111
111
    def _get_format_string(self):
112
112
        """Return format string for this exception or None"""
154
154
                return s.encode('utf8')
155
155
            return s
156
156
        except (TypeError, NameError, ValueError, KeyError), e:
157
 
            return 'Unprintable exception %s(%r): %s' \
 
157
            return 'Unprintable exception %s(%r): %r' \
158
158
                % (self.__class__.__name__,
159
 
                   self.__dict__, str(e))
 
159
                   self.__dict__, e)
160
160
 
161
161
 
162
162
class AlreadyBuilding(BzrError):