converse 1.0.22 → 1.0.23

Sign up to get free protection for your applications and to get access to all the features.
@@ -100,6 +100,10 @@ module Converse
100
100
  @conversation = broker.broker_conversation(@broker.open_topic(@concern, @action))
101
101
  @conversation.subscribe(SimpleLogger.new)
102
102
  @should_i_ask ? response = ask : response = say
103
+ if not success?(response)
104
+ response = handle_error!(response)
105
+ return nil if response.nil?
106
+ end
103
107
  translated_response = broker.translate_response(response)
104
108
  interpret_conversation(translated_response)
105
109
  end
@@ -108,6 +112,14 @@ module Converse
108
112
  response
109
113
  end
110
114
 
115
+ def success?(response)
116
+ true
117
+ end
118
+
119
+ def handle_error!(response)
120
+ response
121
+ end
122
+
111
123
  def ensure_that(substance)
112
124
  @validation = substance
113
125
  self
@@ -32,13 +32,12 @@ module Converse
32
32
  path + "?" + compile_params(params)
33
33
  end
34
34
 
35
- def response_ok?(response)
35
+ def success?(response)
36
36
  test_value = "#{response.code}"
37
37
  return test_value == "200"
38
38
  end
39
39
 
40
40
  def interpret_conversation(response)
41
- format_error(response) if not response_ok?(response)
42
41
  return format_response(response.body)
43
42
  end
44
43
 
@@ -1,3 +1,3 @@
1
1
  module Converse
2
- VERSION = "1.0.22"
2
+ VERSION = "1.0.23"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: converse
3
3
  version: !ruby/object:Gem::Version
4
- hash: 59
4
+ hash: 57
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 22
10
- version: 1.0.22
9
+ - 23
10
+ version: 1.0.23
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ernst van Graan