~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: Martin
  • Date: 2009-11-07 08:02:13 UTC
  • mfrom: (4789 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4809.
  • Revision ID: gzlist@googlemail.com-20091107080213-jad185091b3l69ih
Merge bzr.dev 4789 to resolve conflict from the disabling of plink auto-detection, and relocate NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
793
793
 
794
794
 
795
795
class IncompatibleRepositories(BzrError):
 
796
    """Report an error that two repositories are not compatible.
 
797
 
 
798
    Note that the source and target repositories are permitted to be strings:
 
799
    this exception is thrown from the smart server and may refer to a
 
800
    repository the client hasn't opened.
 
801
    """
796
802
 
797
803
    _fmt = "%(target)s\n" \
798
804
            "is not compatible with\n" \
2006
2012
 
2007
2013
class BadConversionTarget(BzrError):
2008
2014
 
2009
 
    _fmt = "Cannot convert to format %(format)s.  %(problem)s"
 
2015
    _fmt = "Cannot convert from format %(from_format)s to format %(format)s." \
 
2016
            "    %(problem)s"
2010
2017
 
2011
 
    def __init__(self, problem, format):
 
2018
    def __init__(self, problem, format, from_format=None):
2012
2019
        BzrError.__init__(self)
2013
2020
        self.problem = problem
2014
2021
        self.format = format
 
2022
        self.from_format = from_format or '(unspecified)'
2015
2023
 
2016
2024
 
2017
2025
class NoDiffFound(BzrError):
2918
2926
    _fmt = 'Cannot bind address "%(host)s:%(port)i": %(orig_error)s.'
2919
2927
 
2920
2928
    def __init__(self, host, port, orig_error):
 
2929
        # nb: in python2.4 socket.error doesn't have a useful repr
2921
2930
        BzrError.__init__(self, host=host, port=port,
2922
 
            orig_error=orig_error[1])
 
2931
            orig_error=repr(orig_error.args))
2923
2932
 
2924
2933
 
2925
2934
class UnknownRules(BzrError):