stomp_publisher 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/stomp_publisher/connection_error.rb +5 -1
- data/lib/stomp_publisher/version.rb +1 -1
- data/lib/stomp_publisher.rb +6 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f97f60622764c7e685c66a7519103f286f1cd87
|
4
|
+
data.tar.gz: 9179e5ec0119211b616f2ae328ff3b47c4ed7216
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e2345c582e0f6b14978b544867788c3a771fc1022af895d1fed1f46c4081014908f4fab96f84a3d99b4b3e2cd49aef693e967a2fe4ed099e54b69233f9be070
|
7
|
+
data.tar.gz: 38373a6d38f33ebff7df00876fc9ff4a428dedef8c4a7f455a2ceb87a34a583e567fff0ef58f3f1489546a8e9cd46a2ddbaf07ccf4ddb9a44dab88470a8935b6
|
@@ -3,8 +3,12 @@ class StompPublisher
|
|
3
3
|
attr_accessor :frame
|
4
4
|
|
5
5
|
def initialize(msg, frame)
|
6
|
-
super(msg)
|
7
6
|
self.frame = frame
|
7
|
+
if (frame && frame.command == "ERROR" && !frame.body.nil? && frame.body.length > 0)
|
8
|
+
msg = "%s: %s" % [ msg, frame.body ]
|
9
|
+
end
|
10
|
+
|
11
|
+
super(msg)
|
8
12
|
end
|
9
13
|
end
|
10
14
|
end
|
data/lib/stomp_publisher.rb
CHANGED
@@ -37,7 +37,7 @@ class StompPublisher
|
|
37
37
|
|
38
38
|
response_frame = read_frame(socket)
|
39
39
|
if (response_frame.command != "CONNECTED")
|
40
|
-
raise ConnectionError.new("Failed to login
|
40
|
+
raise ConnectionError.new("Failed to login", response_frame)
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
@@ -46,10 +46,12 @@ class StompPublisher
|
|
46
46
|
socket.write(frame.to_s)
|
47
47
|
|
48
48
|
response_frame = read_frame(socket)
|
49
|
-
if (response_frame.command
|
50
|
-
raise ConnectionError.new("
|
49
|
+
if (response_frame.command == "ERROR")
|
50
|
+
raise ConnectionError.new("Connection error", response_frame)
|
51
|
+
elsif (response_frame.command != "RECEIPT")
|
52
|
+
raise ConnectionError.new("Unexpected response: #{response_frame.command}", response_frame)
|
51
53
|
elsif ((response_receipt = response_frame.header["receipt-id"]) != receipt_id)
|
52
|
-
raise ConnectionError.new("
|
54
|
+
raise ConnectionError.new("Unexpected receipt id: #{response_receipt}", response_frame)
|
53
55
|
end
|
54
56
|
|
55
57
|
receipt_id
|