Package qpid :: Package messaging :: Module exceptions
[frames] | no frames]

Source Code for Module qpid.messaging.exceptions

  1  # 
  2  # Licensed to the Apache Software Foundation (ASF) under one 
  3  # or more contributor license agreements.  See the NOTICE file 
  4  # distributed with this work for additional information 
  5  # regarding copyright ownership.  The ASF licenses this file 
  6  # to you under the Apache License, Version 2.0 (the 
  7  # "License"); you may not use this file except in compliance 
  8  # with the License.  You may obtain a copy of the License at 
  9  # 
 10  #   http://www.apache.org/licenses/LICENSE-2.0 
 11  # 
 12  # Unless required by applicable law or agreed to in writing, 
 13  # software distributed under the License is distributed on an 
 14  # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
 15  # KIND, either express or implied.  See the License for the 
 16  # specific language governing permissions and limitations 
 17  # under the License. 
 18  # 
 19   
20 -class Timeout(Exception):
21 pass
22 23 ## Messaging Errors 24
25 -class MessagingError(Exception):
26
27 - def __init__(self, code=None, text=None, **info):
28 self.code = code 29 self.text = text 30 self.info = info 31 if self.code is None: 32 msg = self.text 33 else: 34 msg = "%s(%s)" % (self.text, self.code) 35 if info: 36 msg += " " + ", ".join(["%s=%r" % (k, v) for k, v in self.info.items()]) 37 Exception.__init__(self, msg)
38
39 -class InternalError(MessagingError):
40 pass
41 42 ## Connection Errors 43
44 -class ConnectionError(MessagingError):
45 """ 46 The base class for all connection related exceptions. 47 """ 48 pass
49
50 -class ConnectError(ConnectionError):
51 """ 52 Exception raised when there is an error connecting to the remote 53 peer. 54 """ 55 pass
56
57 -class VersionError(ConnectError):
58 pass
59
60 -class AuthenticationFailure(ConnectError):
61 pass
62
63 -class ConnectionClosed(ConnectionError):
64 pass
65
66 -class HeartbeatTimeout(ConnectionError):
67 pass
68 69 ## Session Errors 70
71 -class SessionError(MessagingError):
72 pass
73
74 -class Detached(SessionError):
75 """ 76 Exception raised when an operation is attempted that is illegal when 77 detached. 78 """ 79 pass
80
81 -class NontransactionalSession(SessionError):
82 """ 83 Exception raised when commit or rollback is attempted on a non 84 transactional session. 85 """ 86 pass
87
88 -class TransactionError(SessionError):
89 pass
90
91 -class TransactionAborted(TransactionError):
92 pass
93
94 -class UnauthorizedAccess(SessionError):
95 pass
96
97 -class ServerError(SessionError):
98 pass
99
100 -class SessionClosed(SessionError):
101 pass
102 103 ## Link Errors 104
105 -class LinkError(MessagingError):
106 pass
107
108 -class InsufficientCapacity(LinkError):
109 pass
110
111 -class AddressError(LinkError):
112 pass
113
114 -class MalformedAddress(AddressError):
115 pass
116
117 -class InvalidOption(AddressError):
118 pass
119
120 -class ResolutionError(AddressError):
121 pass
122
123 -class AssertionFailed(ResolutionError):
124 pass
125
126 -class NotFound(ResolutionError):
127 pass
128
129 -class LinkClosed(LinkError):
130 pass
131 132 ## Sender Errors 133
134 -class SenderError(LinkError):
135 pass
136
137 -class SendError(SenderError):
138 pass
139
140 -class TargetCapacityExceeded(SendError):
141 pass
142 143 ## Receiver Errors 144
145 -class ReceiverError(LinkError):
146 pass
147
148 -class FetchError(ReceiverError):
149 pass
150
151 -class Empty(FetchError):
152 """ 153 Exception raised by L{Receiver.fetch} when there is no message 154 available within the alloted time. 155 """ 156 pass
157