/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: 2017-07-24 01:07:36 UTC
  • mfrom: (6734.1.7 move-errors-views)
  • Revision ID: jelmer@jelmer.uk-20170724010736-7a67j6n1t2nz914n
Merge lp:~jelmer/bzr/move-errors-views.

Show diffs side-by-side

added added

removed removed

Lines of Context:
146
146
    internal_error = True
147
147
 
148
148
 
149
 
class AlreadyBuilding(BzrError):
150
 
 
151
 
    _fmt = "The tree builder is already building a tree."
152
 
 
153
 
 
154
149
class BranchError(BzrError):
155
150
    """Base class for concrete 'errors about a branch'."""
156
151
 
177
172
        self.msg = msg
178
173
 
179
174
 
180
 
class DisabledMethod(InternalBzrError):
181
 
 
182
 
    _fmt = "The smart server method '%(class_name)s' is disabled."
183
 
 
184
 
    def __init__(self, class_name):
185
 
        BzrError.__init__(self)
186
 
        self.class_name = class_name
187
 
 
188
 
 
189
175
class IncompatibleVersion(BzrError):
190
176
 
191
177
    _fmt = 'API %(api)s is not compatible; one of versions %(wanted)r '\
301
287
        self.base = base
302
288
 
303
289
 
304
 
class NotBuilding(BzrError):
305
 
 
306
 
    _fmt = "Not currently building a tree."
307
 
 
308
 
 
309
290
class NotLocalUrl(BzrError):
310
291
 
311
292
    _fmt = "%(url)s is not a local path."
2503
2484
        self.name = name.decode("utf-8")
2504
2485
 
2505
2486
 
2506
 
class NoDestinationAddress(InternalBzrError):
2507
 
 
2508
 
    _fmt = "Message does not have a destination address."
2509
 
 
2510
 
 
2511
2487
class RepositoryDataStreamError(BzrError):
2512
2488
 
2513
2489
    _fmt = "Corrupt or incompatible data stream: %(reason)s"
2516
2492
        self.reason = reason
2517
2493
 
2518
2494
 
2519
 
class SMTPError(BzrError):
2520
 
 
2521
 
    _fmt = "SMTP error: %(error)s"
2522
 
 
2523
 
    def __init__(self, error):
2524
 
        self.error = error
2525
 
 
2526
 
 
2527
 
class NoMessageSupplied(BzrError):
2528
 
 
2529
 
    _fmt = "No message supplied."
2530
 
 
2531
 
 
2532
 
class NoMailAddressSpecified(BzrError):
2533
 
 
2534
 
    _fmt = "No mail-to address (--mail-to) or output (-o) specified."
2535
 
 
2536
 
 
2537
 
class MailClientNotFound(BzrError):
2538
 
 
2539
 
    _fmt = "Unable to find mail client with the following names:"\
2540
 
        " %(mail_command_list_string)s"
2541
 
 
2542
 
    def __init__(self, mail_command_list):
2543
 
        mail_command_list_string = ', '.join(mail_command_list)
2544
 
        BzrError.__init__(self, mail_command_list=mail_command_list,
2545
 
                          mail_command_list_string=mail_command_list_string)
2546
 
 
2547
 
class SMTPConnectionRefused(SMTPError):
2548
 
 
2549
 
    _fmt = "SMTP connection to %(host)s refused"
2550
 
 
2551
 
    def __init__(self, error, host):
2552
 
        self.error = error
2553
 
        self.host = host
2554
 
 
2555
 
 
2556
 
class DefaultSMTPConnectionRefused(SMTPConnectionRefused):
2557
 
 
2558
 
    _fmt = "Please specify smtp_server.  No server at default %(host)s."
2559
 
 
2560
 
 
2561
2495
class BzrDirError(BzrError):
2562
2496
 
2563
2497
    def __init__(self, controldir):
2708
2642
        self.timezone = timezone
2709
2643
 
2710
2644
 
2711
 
class CommandAvailableInPlugin(Exception):
2712
 
 
2713
 
    internal_error = False
2714
 
 
2715
 
    def __init__(self, cmd_name, plugin_metadata, provider):
2716
 
 
2717
 
        self.plugin_metadata = plugin_metadata
2718
 
        self.cmd_name = cmd_name
2719
 
        self.provider = provider
2720
 
 
2721
 
    def __str__(self):
2722
 
 
2723
 
        _fmt = ('"%s" is not a standard brz command. \n'
2724
 
                'However, the following official plugin provides this command: %s\n'
2725
 
                'You can install it by going to: %s'
2726
 
                % (self.cmd_name, self.plugin_metadata['name'],
2727
 
                    self.plugin_metadata['url']))
2728
 
 
2729
 
        return _fmt
2730
 
 
2731
 
 
2732
 
class NoPluginAvailable(BzrError):
2733
 
    pass
2734
 
 
2735
 
 
2736
2645
class UnableEncodePath(BzrError):
2737
2646
 
2738
2647
    _fmt = ('Unable to encode %(kind)s path %(path)r in '
2804
2713
        self.msg = msg
2805
2714
 
2806
2715
 
2807
 
class ShelfCorrupt(BzrError):
2808
 
 
2809
 
    _fmt = "Shelf corrupt."
2810
 
 
2811
 
 
2812
2716
class DecompressCorruption(BzrError):
2813
2717
 
2814
2718
    _fmt = "Corruption while decompressing repository file%(orig_error)s"
2821
2725
        BzrError.__init__(self)
2822
2726
 
2823
2727
 
2824
 
class NoSuchShelfId(BzrError):
2825
 
 
2826
 
    _fmt = 'No changes are shelved with id "%(shelf_id)d".'
2827
 
 
2828
 
    def __init__(self, shelf_id):
2829
 
        BzrError.__init__(self, shelf_id=shelf_id)
2830
 
 
2831
 
 
2832
 
class InvalidShelfId(BzrError):
2833
 
 
2834
 
    _fmt = '"%(invalid_id)s" is not a valid shelf id, try a number instead.'
2835
 
 
2836
 
    def __init__(self, invalid_id):
2837
 
        BzrError.__init__(self, invalid_id=invalid_id)
2838
 
 
2839
 
 
2840
2728
class JailBreak(BzrError):
2841
2729
 
2842
2730
    _fmt = "An attempt to access a url outside the server jail was made: '%(url)s'."
2858
2746
        BzrError.__init__(self, format=format, url=url)
2859
2747
 
2860
2748
 
2861
 
class NoSuchView(BzrError):
2862
 
    """A view does not exist.
2863
 
    """
2864
 
 
2865
 
    _fmt = u"No such view: %(view_name)s."
2866
 
 
2867
 
    def __init__(self, view_name):
2868
 
        self.view_name = view_name
2869
 
 
2870
 
 
2871
 
class ViewsNotSupported(BzrError):
2872
 
    """Views are not supported by a tree format.
2873
 
    """
2874
 
 
2875
 
    _fmt = ("Views are not supported by %(tree)s;"
2876
 
            " use 'brz upgrade' to change your tree to a later format.")
2877
 
 
2878
 
    def __init__(self, tree):
2879
 
        self.tree = tree
2880
 
 
2881
 
 
2882
 
class FileOutsideView(BzrError):
2883
 
 
2884
 
    _fmt = ('Specified file "%(file_name)s" is outside the current view: '
2885
 
            '%(view_str)s')
2886
 
 
2887
 
    def __init__(self, file_name, view_files):
2888
 
        self.file_name = file_name
2889
 
        self.view_str = ", ".join(view_files)
2890
 
 
2891
 
 
2892
2749
class UnresumableWriteGroup(BzrError):
2893
2750
 
2894
2751
    _fmt = ("Repository %(repository)s cannot resume write group "
2953
2810
        self.branch_url = branch_url
2954
2811
 
2955
2812
 
2956
 
class HpssVfsRequestNotAllowed(BzrError):
2957
 
 
2958
 
    _fmt = ("VFS requests over the smart server are not allowed. Encountered: "
2959
 
            "%(method)s, %(arguments)s.")
2960
 
 
2961
 
    def __init__(self, method, arguments):
2962
 
        self.method = method
2963
 
        self.arguments = arguments
2964
 
 
2965
 
 
2966
2813
class UnsupportedKindChange(BzrError):
2967
2814
 
2968
2815
    _fmt = ("Kind change from %(from_kind)s to %(to_kind)s for "