/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 breezy/errors.py

  • Committer: Jelmer Vernooij
  • Date: 2020-08-05 20:34:11 UTC
  • mfrom: (7490.40.87 work)
  • mto: (7490.40.103 work)
  • mto: This revision was merged to the branch mainline in revision 7521.
  • Revision ID: jelmer@jelmer.uk-20200805203411-cap9gp8vuwnz5lt7
Merge lp:brz/3.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
583
583
        self.format = format
584
584
 
585
585
 
586
 
class LineEndingError(BzrError):
587
 
 
588
 
    _fmt = ("Line ending corrupted for file: %(file)s; "
589
 
            "Maybe your files got corrupted in transport?")
590
 
 
591
 
    def __init__(self, file):
592
 
        self.file = file
593
 
 
594
 
 
595
586
class IncompatibleFormat(BzrError):
596
587
 
597
588
    _fmt = "Format %(format)s is not compatible with .bzr version %(controldir)s."
959
950
        self.revision_id = revision_id
960
951
 
961
952
 
962
 
class InvalidRevisionSpec(BzrError):
963
 
 
964
 
    _fmt = ("Requested revision: '%(spec)s' does not exist in branch:"
965
 
            " %(branch_url)s%(extra)s")
966
 
 
967
 
    def __init__(self, spec, branch, extra=None):
968
 
        BzrError.__init__(self, branch=branch, spec=spec)
969
 
        self.branch_url = getattr(branch, 'user_url', str(branch))
970
 
        if extra:
971
 
            self.extra = '\n' + str(extra)
972
 
        else:
973
 
            self.extra = ''
974
 
 
975
 
 
976
953
class AppendRevisionsOnlyViolation(BzrError):
977
954
 
978
955
    _fmt = ('Operation denied because it would change the main history,'
1323
1300
        TransportError.__init__(self, msg, orig_error=orig_error)
1324
1301
 
1325
1302
 
 
1303
class UnexpectedHttpStatus(InvalidHttpResponse):
 
1304
 
 
1305
    _fmt = "Unexpected HTTP status %(code)d for %(path)s: %(extra)s"
 
1306
 
 
1307
    def __init__(self, path, code, extra=None):
 
1308
        self.path = path
 
1309
        self.code = code
 
1310
        self.extra = extra or ''
 
1311
        full_msg = 'status code %d unexpected' % code
 
1312
        if extra is not None:
 
1313
            full_msg += ': ' + extra
 
1314
        InvalidHttpResponse.__init__(
 
1315
            self, path, full_msg)
 
1316
 
 
1317
 
 
1318
class BadHttpRequest(UnexpectedHttpStatus):
 
1319
 
 
1320
    _fmt = "Bad http request for %(path)s: %(reason)s"
 
1321
 
 
1322
    def __init__(self, path, reason):
 
1323
        self.path = path
 
1324
        self.reason = reason
 
1325
        TransportError.__init__(self, reason)
 
1326
 
 
1327
 
1326
1328
class InvalidHttpRange(InvalidHttpResponse):
1327
1329
 
1328
1330
    _fmt = "Invalid http range %(range)r for %(path)s: %(msg)s"