nats-pure 0.7.2 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,68 @@
1
+ # Copyright 2021 The NATS Authors
2
+ # Licensed under the Apache License, Version 2.0 (the "License");
3
+ # you may not use this file except in compliance with the License.
4
+ # You may obtain a copy of the License at
5
+ #
6
+ # http://www.apache.org/licenses/LICENSE-2.0
7
+ #
8
+ # Unless required by applicable law or agreed to in writing, software
9
+ # distributed under the License is distributed on an "AS IS" BASIS,
10
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ # See the License for the specific language governing permissions and
12
+ # limitations under the License.
13
+ #
14
+
15
+ module NATS
16
+ module IO
17
+ class Error < StandardError; end
18
+
19
+ # When the NATS server sends us an 'ERR' message.
20
+ class ServerError < Error; end
21
+
22
+ # When we detect error on the client side.
23
+ class ClientError < Error; end
24
+
25
+ # When we cannot connect to the server (either initially or after a reconnect).
26
+ class ConnectError < Error; end
27
+
28
+ # When we cannot connect to the server because authorization failed.
29
+ class AuthError < ConnectError; end
30
+
31
+ # When we cannot connect serverince there are no servers available.
32
+ class NoServersError < ConnectError; end
33
+
34
+ # When there are no subscribers available to respond.
35
+ class NoRespondersError < ConnectError; end
36
+
37
+ # When the connection exhausts max number of pending pings replies.
38
+ class StaleConnectionError < Error; end
39
+
40
+ # When we do not get a result within a specified time.
41
+ class Timeout < Error; end
42
+
43
+ # When there is an i/o timeout with the socket.
44
+ class SocketTimeoutError < Timeout; end
45
+
46
+ # When we use an invalid subject.
47
+ class BadSubject < Error; end
48
+
49
+ # When an invalid subscription is used, like one already unsubscribed
50
+ # or when the NATS connection is already closed.
51
+ class BadSubscription < Error; end
52
+
53
+ # When a subscription hits the pending messages limit.
54
+ class SlowConsumer < Error; end
55
+
56
+ # When an action cannot be done because client is draining.
57
+ class ConnectionDrainingError < Error; end
58
+
59
+ # When drain takes too long to complete.
60
+ class DrainTimeoutError < Error; end
61
+ end
62
+
63
+ # Timeout is raised when the client gives up waiting for a response from a service.
64
+ Timeout = ::NATS::IO::Timeout
65
+
66
+ # Error is any error thrown by the client library.
67
+ Error = ::NATS::IO::Error
68
+ end