~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: Martin Pool
  • Date: 2005-09-01 11:27:20 UTC
  • Revision ID: mbp@sourcefrog.net-20050901112720-f5ccb6b6627991de
- work properly when $EDITOR contains multiple words

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
######################################################################
24
24
# exceptions 
25
25
class BzrError(StandardError):
26
 
    def __str__(self):
27
 
        if len(self.args) == 1:
28
 
            return self.args[0]
29
 
        elif len(self.args) == 2:
30
 
            # further explanation or suggestions
31
 
            return '\n  '.join([self.args[0]] + self.args[1])
32
 
        else:
33
 
            return `self.args`
34
 
 
 
26
    pass
35
27
 
36
28
class BzrCheckError(BzrError):
37
29
    pass
100
92
        BzrError.__init__(self, msg)
101
93
 
102
94
 
103
 
class HistoryMissing(BzrError):
104
 
    def __init__(self, branch, object_type, object_id):
105
 
        self.branch = branch
106
 
        BzrError.__init__(self,
107
 
                          '%s is missing %s {%s}'
108
 
                          % (branch, object_type, object_id))
109
 
 
110
 
 
111
95
class UnrelatedBranches(BzrCommandError):
112
96
    def __init__(self):
113
97
        msg = "Branches have no common ancestor, and no base revision"\
115
99
        BzrCommandError.__init__(self, msg)
116
100
 
117
101
 
118
 
class NotAncestor(BzrError):
119
 
    def __init__(self, rev_id, not_ancestor_id):
120
 
        self.rev_id = rev_id
121
 
        self.not_ancestor_id = not_ancestor_id
122
 
        msg = "Revision %s is not an ancestor of %s" % (not_ancestor_id, 
123
 
                                                        rev_id)
124
 
        BzrError.__init__(self, msg)
125
 
 
126
 
 
127
102
class InstallFailed(BzrError):
128
103
    def __init__(self, revisions):
129
104
        self.revisions = revisions