/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: John Arbash Meinel
  • Date: 2006-09-16 02:14:14 UTC
  • mfrom: (2016 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2017.
  • Revision ID: john@arbash-meinel.com-20060916021414-bd9e4cb9ac173022
[merge] bzr.dev 2016

Show diffs side-by-side

added added

removed removed

Lines of Context:
132
132
            if isinstance(s, unicode):
133
133
                return s.encode('utf8')
134
134
            return s
135
 
        except (NameError, ValueError, KeyError), e:
136
 
            return 'Unprintable exception %s: %s' \
137
 
                % (self.__class__.__name__, str(e))
 
135
        except (TypeError, NameError, ValueError, KeyError), e:
 
136
            return 'Unprintable exception %s(%r): %s' \
 
137
                % (self.__class__.__name__,
 
138
                   self.__dict__, str(e))
138
139
 
139
140
 
140
141
class BzrCheckError(BzrNewError):
802
803
        BzrNewError.__init__(self)
803
804
 
804
805
 
 
806
class SmartProtocolError(TransportError):
 
807
    """Generic bzr smart protocol error: %(details)s"""
 
808
 
 
809
    def __init__(self, details):
 
810
        self.details = details
 
811
 
 
812
 
805
813
# A set of semi-meaningful errors which can be thrown
806
814
class TransportNotPossible(TransportError):
807
815
    """Transport operation not possible: %(msg)s %(orig_error)%"""
1180
1188
        BadInventoryFormat.__init__(self, msg=msg)
1181
1189
 
1182
1190
 
 
1191
class NoSmartServer(NotBranchError):
 
1192
    """No smart server available at %(url)s"""
 
1193
 
 
1194
    def __init__(self, url):
 
1195
        self.url = url
 
1196
 
 
1197
 
1183
1198
class UnknownSSH(BzrNewError):
1184
1199
    """Unrecognised value for BZR_SSH environment variable: %(vendor)s"""
1185
1200
 
1194
1209
    def __init__(self, revision_id):
1195
1210
        BzrNewError.__init__(self)
1196
1211
        self.revision_id = revision_id
 
1212
 
 
1213
 
 
1214
class IllegalUseOfScopeReplacer(BzrNewError):
 
1215
    """ScopeReplacer object %(name)r was used incorrectly: %(msg)s%(extra)s"""
 
1216
 
 
1217
    is_user_error = False
 
1218
 
 
1219
    def __init__(self, name, msg, extra=None):
 
1220
        BzrNewError.__init__(self)
 
1221
        self.name = name
 
1222
        self.msg = msg
 
1223
        if extra:
 
1224
            self.extra = ': ' + str(extra)
 
1225
        else:
 
1226
            self.extra = ''
 
1227
 
 
1228
 
 
1229
class InvalidImportLine(BzrNewError):
 
1230
    """Not a valid import statement: %(msg)\n%(text)s"""
 
1231
 
 
1232
    is_user_error = False
 
1233
 
 
1234
    def __init__(self, text, msg):
 
1235
        BzrNewError.__init__(self)
 
1236
        self.text = text
 
1237
        self.msg = msg
 
1238
 
 
1239
 
 
1240
class ImportNameCollision(BzrNewError):
 
1241
    """Tried to import an object to the same name as an existing object. %(name)s"""
 
1242
 
 
1243
    is_user_error = False
 
1244
 
 
1245
    def __init__(self, name):
 
1246
        BzrNewError.__init__(self)
 
1247
        self.name = name