connect_wise_rest 0.4.0 → 0.4.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: 1b62fcdc5634c4805b7aa509a82afe462ed63776
4
- data.tar.gz: 3dfe755ab510429f9ea77598208ab3899091b860
3
+ metadata.gz: decfe27e68af0ed76de1037fdffd51009a2ecc6d
4
+ data.tar.gz: 87071170b2581bbd0d50b7497770c2c16b0d525a
5
5
  SHA512:
6
- metadata.gz: b80c333044bd6c53532ddb8c08355d125c29d05ac4c607a42ccfd0602c22b9ad52aafe3320c08d18d34e487f2cbe36629f372b85fafed6f1780a8dac670a4ec9
7
- data.tar.gz: ccd95c72174593bfffec8c41b43a07ad32a00dfb6e8d907905edb27a3fdf5e1e76c8b84e8eccd194337bad6a42911ad8e8800de5884dc2d5767f5c9d76181d34
6
+ metadata.gz: 84626b8af66c1afa99f665b49721bc74dc2b5be5a9f9c7c213e5e65c5f7ed31b5abae9cc3f22a6f8d528b1faf95f8bc26e11c78104a569652d7d7369b179dd88
7
+ data.tar.gz: 6e792cfcfb2bf8cc9853f4c8e71fe7419ba469e79e1d3563f3d247061268c9c017e28873efccfd1ef63b70f5407bdf8cb495e0f5f75c30a260ae2c3dcfc92b9d
@@ -24,9 +24,7 @@ module ConnectWiseRest
24
24
  self.options[:query].merge!(query)
25
25
  @response = nil
26
26
 
27
- unless response.success?
28
- raise "#{response.parsed_response['code']}: #{response.parsed_response['message']}"
29
- end
27
+ raise_error(response) unless response.success?
30
28
 
31
29
  @data = response.parsed_response
32
30
  end
@@ -75,5 +73,14 @@ module ConnectWiseRest
75
73
  return fetch
76
74
  end
77
75
 
76
+ private
77
+
78
+ def raise_error(response)
79
+ if response.parsed_response
80
+ raise "#{response.parsed_response['code']}: #{response.parsed_response['message']}"
81
+ else
82
+ raise response.body
83
+ end
84
+ end
78
85
  end
79
86
  end
@@ -1,3 +1,3 @@
1
1
  module ConnectWiseRest
2
- VERSION = '0.4.0'
2
+ VERSION = '0.4.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: connect_wise_rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Pheasey
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-18 00:00:00.000000000 Z
11
+ date: 2018-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler