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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1a06c015c42df9acf3aa489fd8f83185eaba3fd4
4
- data.tar.gz: 125c8db2ccba8513d3d8fe390357f65349756dc0
3
+ metadata.gz: 4f97f60622764c7e685c66a7519103f286f1cd87
4
+ data.tar.gz: 9179e5ec0119211b616f2ae328ff3b47c4ed7216
5
5
  SHA512:
6
- metadata.gz: 25c6767732759e8e8b6896047b9c159aa45b82c6b9fc22f9f540285e36ff169868424f7b453d722ed2b169d7ee1154136c3aacf23fcc9e606b1ccf9ad26a24e7
7
- data.tar.gz: d8a71e807a0767a1fe939869fc1ac4d7d18fe9ef43db3ef402b7b8614ae456e53fe3d309a4639f0fbff2efc4df1cc19e0ab329f593b0fb40d6a81b95189ecc2e
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
@@ -1,3 +1,3 @@
1
1
  class StompPublisher
2
- VERSION = "0.9.0"
2
+ VERSION = "0.9.1"
3
3
  end
@@ -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: #{response_frame.body}", response_frame)
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 != "RECEIPT")
50
- raise ConnectionError.new("Did not receive expected receipt", response_frame)
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("Received unexpected receipt id: #{response_receipt}", response_frame)
54
+ raise ConnectionError.new("Unexpected receipt id: #{response_receipt}", response_frame)
53
55
  end
54
56
 
55
57
  receipt_id
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stomp_publisher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Abreu