Package duplicity :: Module errors
[hide private]
[frames] | no frames]

Source Code for Module duplicity.errors

 1  # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- 
 2  # 
 3  # Copyright 2002 Ben Escoto <ben@emerose.org> 
 4  # Copyright 2007 Kenneth Loafman <kenneth@loafman.com> 
 5  # 
 6  # This file is part of duplicity. 
 7  # 
 8  # Duplicity is free software; you can redistribute it and/or modify it 
 9  # under the terms of the GNU General Public License as published by the 
10  # Free Software Foundation; either version 2 of the License, or (at your 
11  # option) any later version. 
12  # 
13  # Duplicity is distributed in the hope that it will be useful, but 
14  # WITHOUT ANY WARRANTY; without even the implied warranty of 
15  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
16  # General Public License for more details. 
17  # 
18  # You should have received a copy of the GNU General Public License 
19  # along with duplicity; if not, write to the Free Software Foundation, 
20  # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
21   
22  """ 
23  Error/exception classes that do not fit naturally anywhere else. 
24  """ 
25   
26 -class DuplicityError(Exception):
27 pass
28
29 -class UserError(DuplicityError):
30 """ 31 Subclasses use this in their inheritance hierarchy to signal that 32 the error is a user generated one, and that it is therefore 33 typically unsuitable to display a full stack trace. 34 """ 35 pass
36
37 -class NotSupported(DuplicityError):
38 """ 39 Exception raised when an action cannot be completed because some 40 particular feature is not supported by the environment. 41 """ 42 pass
43
44 -class ConflictingScheme(DuplicityError):
45 """ 46 Raised to indicate an attempt was made to register a backend for a 47 scheme for which there is already a backend registered. 48 """ 49 pass
50
51 -class InvalidBackendURL(UserError):
52 """ 53 Raised to indicate a URL was not a valid backend URL. 54 """ 55 pass
56
57 -class UnsupportedBackendScheme(InvalidBackendURL, UserError):
58 """ 59 Raised to indicate that a backend URL was parsed successfully as a 60 URL, but was not supported. 61 """
62 - def __init__(self, url):
63 InvalidBackendURL.__init__(self, 64 ("scheme not supported in url: %s" % (url,))) 65 self.url = url
66
67 -class BackendException(DuplicityError):
68 """ 69 Raised to indicate a backend specific problem. 70 """ 71 pass
72
73 -class TemporaryLoadException(BackendException):
74 """ 75 Raised to indicate a temporary issue on the backend. 76 Duplicity should back off for a bit and try again. 77 """ 78 pass
79