/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-16 01:55:39 UTC
  • mto: This revision was merged to the branch mainline in revision 6740.
  • Revision ID: jelmer@jelmer.uk-20170716015539-esj2f7vjje9366u0
Fix more imports.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2566
2566
        self.name = name.decode("utf-8")
2567
2567
 
2568
2568
 
2569
 
class NoDestinationAddress(InternalBzrError):
2570
 
 
2571
 
    _fmt = "Message does not have a destination address."
2572
 
 
2573
 
 
2574
2569
class RepositoryDataStreamError(BzrError):
2575
2570
 
2576
2571
    _fmt = "Corrupt or incompatible data stream: %(reason)s"
2579
2574
        self.reason = reason
2580
2575
 
2581
2576
 
2582
 
class SMTPError(BzrError):
2583
 
 
2584
 
    _fmt = "SMTP error: %(error)s"
2585
 
 
2586
 
    def __init__(self, error):
2587
 
        self.error = error
2588
 
 
2589
 
 
2590
 
class NoMessageSupplied(BzrError):
2591
 
 
2592
 
    _fmt = "No message supplied."
2593
 
 
2594
 
 
2595
 
class NoMailAddressSpecified(BzrError):
2596
 
 
2597
 
    _fmt = "No mail-to address (--mail-to) or output (-o) specified."
2598
 
 
2599
 
 
2600
 
class MailClientNotFound(BzrError):
2601
 
 
2602
 
    _fmt = "Unable to find mail client with the following names:"\
2603
 
        " %(mail_command_list_string)s"
2604
 
 
2605
 
    def __init__(self, mail_command_list):
2606
 
        mail_command_list_string = ', '.join(mail_command_list)
2607
 
        BzrError.__init__(self, mail_command_list=mail_command_list,
2608
 
                          mail_command_list_string=mail_command_list_string)
2609
 
 
2610
 
class SMTPConnectionRefused(SMTPError):
2611
 
 
2612
 
    _fmt = "SMTP connection to %(host)s refused"
2613
 
 
2614
 
    def __init__(self, error, host):
2615
 
        self.error = error
2616
 
        self.host = host
2617
 
 
2618
 
 
2619
 
class DefaultSMTPConnectionRefused(SMTPConnectionRefused):
2620
 
 
2621
 
    _fmt = "Please specify smtp_server.  No server at default %(host)s."
2622
 
 
2623
 
 
2624
2577
class BzrDirError(BzrError):
2625
2578
 
2626
2579
    def __init__(self, controldir):
2771
2724
        self.timezone = timezone
2772
2725
 
2773
2726
 
2774
 
class CommandAvailableInPlugin(Exception):
2775
 
 
2776
 
    internal_error = False
2777
 
 
2778
 
    def __init__(self, cmd_name, plugin_metadata, provider):
2779
 
 
2780
 
        self.plugin_metadata = plugin_metadata
2781
 
        self.cmd_name = cmd_name
2782
 
        self.provider = provider
2783
 
 
2784
 
    def __str__(self):
2785
 
 
2786
 
        _fmt = ('"%s" is not a standard brz command. \n'
2787
 
                'However, the following official plugin provides this command: %s\n'
2788
 
                'You can install it by going to: %s'
2789
 
                % (self.cmd_name, self.plugin_metadata['name'],
2790
 
                    self.plugin_metadata['url']))
2791
 
 
2792
 
        return _fmt
2793
 
 
2794
 
 
2795
 
class NoPluginAvailable(BzrError):
2796
 
    pass
2797
 
 
2798
 
 
2799
2727
class UnableEncodePath(BzrError):
2800
2728
 
2801
2729
    _fmt = ('Unable to encode %(kind)s path %(path)r in '
2883
2811
        self.msg = msg
2884
2812
 
2885
2813
 
2886
 
class ShelfCorrupt(BzrError):
2887
 
 
2888
 
    _fmt = "Shelf corrupt."
2889
 
 
2890
 
 
2891
2814
class DecompressCorruption(BzrError):
2892
2815
 
2893
2816
    _fmt = "Corruption while decompressing repository file%(orig_error)s"
2900
2823
        BzrError.__init__(self)
2901
2824
 
2902
2825
 
2903
 
class NoSuchShelfId(BzrError):
2904
 
 
2905
 
    _fmt = 'No changes are shelved with id "%(shelf_id)d".'
2906
 
 
2907
 
    def __init__(self, shelf_id):
2908
 
        BzrError.__init__(self, shelf_id=shelf_id)
2909
 
 
2910
 
 
2911
 
class InvalidShelfId(BzrError):
2912
 
 
2913
 
    _fmt = '"%(invalid_id)s" is not a valid shelf id, try a number instead.'
2914
 
 
2915
 
    def __init__(self, invalid_id):
2916
 
        BzrError.__init__(self, invalid_id=invalid_id)
2917
 
 
2918
 
 
2919
2826
class JailBreak(BzrError):
2920
2827
 
2921
2828
    _fmt = "An attempt to access a url outside the server jail was made: '%(url)s'."
2937
2844
        BzrError.__init__(self, format=format, url=url)
2938
2845
 
2939
2846
 
2940
 
class NoSuchView(BzrError):
2941
 
    """A view does not exist.
2942
 
    """
2943
 
 
2944
 
    _fmt = u"No such view: %(view_name)s."
2945
 
 
2946
 
    def __init__(self, view_name):
2947
 
        self.view_name = view_name
2948
 
 
2949
 
 
2950
 
class ViewsNotSupported(BzrError):
2951
 
    """Views are not supported by a tree format.
2952
 
    """
2953
 
 
2954
 
    _fmt = ("Views are not supported by %(tree)s;"
2955
 
            " use 'brz upgrade' to change your tree to a later format.")
2956
 
 
2957
 
    def __init__(self, tree):
2958
 
        self.tree = tree
2959
 
 
2960
 
 
2961
 
class FileOutsideView(BzrError):
2962
 
 
2963
 
    _fmt = ('Specified file "%(file_name)s" is outside the current view: '
2964
 
            '%(view_str)s')
2965
 
 
2966
 
    def __init__(self, file_name, view_files):
2967
 
        self.file_name = file_name
2968
 
        self.view_str = ", ".join(view_files)
2969
 
 
2970
 
 
2971
2847
class UnresumableWriteGroup(BzrError):
2972
2848
 
2973
2849
    _fmt = ("Repository %(repository)s cannot resume write group "