~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: Martin Pool
  • Date: 2005-09-07 05:12:06 UTC
  • Revision ID: mbp@sourcefrog.net-20050907051206-26ebb03223c51752
- better string formatting of BzrErrors with explanation

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
######################################################################
24
24
# exceptions 
25
25
class BzrError(StandardError):
26
 
    pass
 
26
    def __str__(self):
 
27
        if len(self.args) == 2:
 
28
            # further explanation or suggestions
 
29
            return '\n  '.join([self.args[0]] + self.args[1])
 
30
        else:
 
31
            return `self.args`
 
32
 
27
33
 
28
34
class BzrCheckError(BzrError):
29
35
    pass