Debian Codegraph @

ruby/lib/core/exceptions.rb

raw
1 # Licensed to the Apache Software Foundation (ASF) under one
2 # or more contributor license agreements. See the NOTICE file
3 # distributed with this work for additional information
4 # regarding copyright ownership. The ASF licenses this file
5 # to you under the Apache License, Version 2.0 (the
6 # "License"); you may not use this file except in compliance
7 # with the License. You may obtain a copy of the License at
8 #
9 # http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing,
12 # software distributed under the License is distributed on an
13 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 # KIND, either express or implied. See the License for the
15 # specific language governing permissions and limitations
16 # under the License.
17
18
19 module Qpid::Proton
20
21 # @private
22 module Error
23 NONE = 0
24 EOS = Cproton::PN_EOS
25 ERROR = Cproton::PN_ERR
26 OVERFLOW = Cproton::PN_OVERFLOW
27 UNDERFLOW = Cproton::PN_UNDERFLOW
28 STATE = Cproton::PN_STATE_ERR
29 ARGUMENT = Cproton::PN_ARG_ERR
30 TIMEOUT = Cproton::PN_TIMEOUT
31 INTERRUPTED = Cproton::PN_INTR
32 INPROGRESS = Cproton::PN_INPROGRESS
33 end
34
35 # Represents a generic error at the messaging level.
36 #
37 class ProtonError < RuntimeError
38 end
39
40 # Represents an end-of-stream error while messaging.
41 #
42 class EOSError < ProtonError
43 end
44
45 # Represents a data overflow exception while messaging.
46 #
47 class OverflowError < ProtonError
48 end
49
50 # Represents a data underflow exception while messaging.
51 #
52 class UnderflowError < ProtonError
53 end
54
55 # Represents an invalid, missing or illegal argument while messaging.
56 #
57 class ArgumentError < ProtonError
58 end
59
60 # Represents that the client has got into an unexpected state during
61 # messaging.
62 #
63 class StateError < ProtonError
64 end
65
66 # Represents a timeout during messaging.
67 #
68 class TimeoutError < ProtonError
69 end
70
71 # Represents an interrupting during a blocking I/O operation.
72 #
73 class InterruptedError < ProtonError
74 end
75
76 class InProgressError < ProtonError
77 end
78
79 # Raised by instances of Transport.
80 #
81 class TransportError < ProtonError
82 end
83
84 # Raised by instances of SASL
85 #
86 class SASLError < TransportError
87 end
88
89 # Raised by Session.
90 #
91 class SessionError < ProtonError
92 end
93
94 # Raised when an attempt is made to change an attribute that is read-only.
95 #
96 class AttributeError < ProtonError
97 end
98
99 # Raised by link components.
100 #
101 class LinkError < ProtonError
102 end
103
104 class SSLError < TransportError
105 end
106
107 class SSLUnavailableError < SSLError
108 end
109
110 # Raised when a message is rejected.
111 #
112 class Reject < ProtonError
113 end
114
115 # Raised when a message is released.
116 #
117 class Release < ProtonError
118 end
119
120 # Raised when a message is aborted by the sender.
121 #
122 class AbortedError < ProtonError
123 end
124
125 # Raised to stop an automatic response to an endpoint open/close,
126 # so that the application can delay completing the open/close to a later time.
127 class StopAutoResponse < ProtonError
128 end
129
130 # Raised when a method is called on an object that has been stopped.
131 class StoppedError < StateError
132 end
133 end