Package cloudfiles :: Module errors
[frames] | no frames]

Source Code for Module cloudfiles.errors

  1  """ 
  2  exception classes 
  3   
  4  See COPYING for license information. 
  5  """ 
  6   
7 -class ResponseError(Exception):
8 """ 9 Raised when the remote service returns an error. 10 """
11 - def __init__(self, status, reason):
12 self.status = status 13 self.reason = reason 14 Exception.__init__(self)
15
16 - def __str__(self):
17 return '%d: %s' % (self.status, self.reason)
18
19 - def __repr__(self):
20 return '%d: %s' % (self.status, self.reason)
21
22 -class NoSuchContainer(Exception):
23 """ 24 Raised on a non-existent Container. 25 """ 26 pass
27
28 -class NoSuchObject(Exception):
29 """ 30 Raised on a non-existent Object. 31 """ 32 pass
33
34 -class ContainerNotEmpty(Exception):
35 """ 36 Raised when attempting to delete a Container that still contains Objects. 37 """
38 - def __init__(self, container_name):
39 self.container_name = container_name
40
41 - def __str__(self):
42 return "Cannot delete non-empty Container %s" % self.container_name
43
44 - def __repr__(self):
45 return "%s(%s)" % (self.__class__.__name__, self.container_name)
46
47 -class InvalidContainerName(Exception):
48 """ 49 Raised for invalid storage container names. 50 """ 51 pass
52
53 -class InvalidObjectName(Exception):
54 """ 55 Raised for invalid storage object names. 56 """ 57 pass
58
59 -class InvalidMetaName(Exception):
60 """ 61 Raised for invalid metadata names. 62 """ 63 pass
64
65 -class InvalidMetaValue(Exception):
66 """ 67 Raised for invalid metadata value. 68 """ 69 pass
70
71 -class InvalidUrl(Exception):
72 """ 73 Not a valid url for use with this software. 74 """ 75 pass
76
77 -class InvalidObjectSize(Exception):
78 """ 79 Not a valid storage_object size attribute. 80 """ 81 pass
82
83 -class IncompleteSend(Exception):
84 """ 85 Raised when there is a insufficient amount of data to send. 86 """ 87 pass
88
89 -class ContainerNotPublic(Exception):
90 """ 91 Raised when public features of a non-public container are accessed. 92 """ 93 pass
94
95 -class CDNNotEnabled(Exception):
96 """ 97 CDN is not enabled for this account. 98 """ 99 pass
100
101 -class AuthenticationFailed(Exception):
102 """ 103 Raised on a failure to authenticate. 104 """ 105 pass
106
107 -class AuthenticationError(Exception):
108 """ 109 Raised when an unspecified authentication error has occurred. 110 """ 111 pass
112