eep_client 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/eep_client.rb +12 -4
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b7b5a6fa352b55489b5a435871b6a66002d6eb0c
4
- data.tar.gz: 6578f9e4ade789687b3eb36805388e2afd364581
3
+ metadata.gz: c4dd7bd071ad6554fb3329c6ba8484c9d4a0f243
4
+ data.tar.gz: 85fda6f250d497527b8970a99f39e1605b25cb2c
5
5
  SHA512:
6
- metadata.gz: 9e4db355cf4b8d507db3e6e28f1b7df2a57b6c7902ffc48a7f9e708990ed2ca5a12b439404fc3218e390a266d64ba20533fa215785bb371d0d17d639df487d99
7
- data.tar.gz: f921facff9366ca2594b58f3c7bd4d676f58bb7c6f64a53bffcf725e6347fe6bd6fa4f12415518004dff17942866bddba042377a81367401e0e7683df361c8fe
6
+ metadata.gz: 96c486a3ae38db0f812d32fe609d9025fa2bc64f1e295c873f7a80cbb3dff004708dad4cfe08e02dd2cfb22d815d892c12ef58c4efec404ddfd2330c465dad65
7
+ data.tar.gz: b74eef5638bec2d0776a451fed98df8214738407c0389d1bbe8d42a3090fb0de0fb0da2234d606baa65bed5424dcc595b5778589a92cd0d790ceeea03d776166
data/lib/eep_client.rb CHANGED
@@ -45,8 +45,12 @@ class EepClient
45
45
  end
46
46
  if @http
47
47
  headers = { ACC_HDR => APP_JSON, CON_HDR => APP_JSON }
48
- res = @http.send_request(POST, EVENT_RESOURCE, json, headers).body
49
- Response.new_instance(JSON.parse(res))
48
+ res = @http.send_request(POST, EVENT_RESOURCE, json, headers)
49
+ if res.is_a? Net::HTTPServerError
50
+ res.error!
51
+ else
52
+ Response.new_instance(JSON.parse(res.body))
53
+ end
50
54
  else
51
55
  Response.mock_event_ok
52
56
  end
@@ -60,8 +64,12 @@ class EepClient
60
64
  end
61
65
  if @http
62
66
  headers = { ACC_HDR => APP_JSON, CON_HDR => APP_JSON }
63
- res = @http.send_request(POST, CLEAR_RESOURCE, json, headers).body
64
- Response.new_instance(JSON.parse(res))
67
+ res = @http.send_request(POST, CLEAR_RESOURCE, json, headers)
68
+ if res.is_a? Net::HTTPServerError
69
+ res.error!
70
+ else
71
+ Response.new_instance(JSON.parse(res.body))
72
+ end
65
73
  else
66
74
  Response.mock_clear_ok
67
75
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eep_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Lewis