redox 1.8.2 → 1.8.3

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
  SHA256:
3
- metadata.gz: 74c2f64a9a4dfe39d514cef7ffffbc202129e08d6a2803447b956abe8dbecf4b
4
- data.tar.gz: 23f406cb77dfd9de5bd4f1a6313c29165a7aded6919497c4f1db2f1e34818085
3
+ metadata.gz: 613d04cb8ea6250a17085c297425e58d3ffd5a8b3c5e9206bb14cb5e5759e2e0
4
+ data.tar.gz: c89b3fb089fdcefc50dc02a56e734a689f2ee2daa20eb5d463ca6c084c1b5e4c
5
5
  SHA512:
6
- metadata.gz: c54ecafcd9e150808e99dfb81fb6dda136a444c4ad547faef43be920063ae433ab7ccaa5c6f697026ddcd9d8d89b736ef45eb760c4440af36ef0d9b992f177a0
7
- data.tar.gz: 2824189ac1f5c5984fafdd8aabafd24f08a5188dfb62d7ec8a1b214614e883cbdfc0ad4d8545b0705ed0c33a59c2a7a57776f2fb3197f639694571778fce2f01
6
+ metadata.gz: 8beb8a1efd15abe04aacca76d3a9dd072a8821338ed35cf1f3c33d6807e04b9b9e9f6df71654fc8db5fb94fc9b32926bc06f0cac1b4810d512a707734f505c3f
7
+ data.tar.gz: 74f7fcdd219eb747bcb560cf371d7bba1208add6ade3a716861322a4dcb930deedbf563567b6c72ae1cf2355960cc50aca4bd7000e9ffb84689574fbcf46a46d
data/CHANGELOG.md CHANGED
@@ -4,9 +4,14 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [1.8.3] - 2022-8-12
8
+ ### Added
9
+ - Improved RedoxException error handling
10
+
7
11
  ## [1.8.2] - 2022-2-23
8
12
  ### Added
9
13
  - DirectAddressFrom and DirectAddressTo to Media Model
14
+
10
15
  ## [1.8.1] - 2022-1-25
11
16
  ### Added
12
17
  - Components, OrderedBy, Indications, and AdministeringProvider to Medication Model
@@ -190,6 +195,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
190
195
  ### Added
191
196
  - Initial Release
192
197
 
198
+ [1.8.3]: https://github.com/WeInfuse/redox/compare/v1.8.2...v1.8.3
193
199
  [1.8.2]: https://github.com/WeInfuse/redox/compare/v1.8.1...v1.8.2
194
200
  [1.8.1]: https://github.com/WeInfuse/redox/compare/v1.8.0...v1.8.1
195
201
  [1.8.0]: https://github.com/WeInfuse/redox/compare/v1.7.4...v1.8.0
@@ -2,15 +2,16 @@ module Redox
2
2
  class RedoxException < Exception
3
3
  def self.from_response(response, msg: nil)
4
4
  exception_msg = "Failed #{msg}:"
5
- exception_msg << " HTTP code: #{response.code} MSG: "
5
+ exception_msg << " HTTP code: #{response&.code} MSG: "
6
6
 
7
7
  begin
8
- error_response = JSON.parse(response.body)
8
+ error_response = response.parsed_response
9
+ error_list = error_response&.[]('Meta')&.[]('Errors')
9
10
 
10
- if (error_response.is_a?(Hash) && error_response.include?("Meta") && error_response["Meta"].include?("Errors"))
11
- exception_msg << error_response["Meta"]["Errors"]
11
+ if error_list
12
+ exception_msg << error_list.map {|el| el['Text'] || el.to_s }.join('|')
12
13
  else
13
- exception_msg << error_response
14
+ exception_msg << error_response.to_s
14
15
  end
15
16
  rescue JSON::ParserError
16
17
  exception_msg << response.body
data/lib/redox/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Redox
2
- VERSION = '1.8.2'.freeze
2
+ VERSION = '1.8.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redox
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.2
4
+ version: 1.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Clark
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2022-02-23 00:00:00.000000000 Z
13
+ date: 2022-08-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: httparty
@@ -202,7 +202,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
202
202
  - !ruby/object:Gem::Version
203
203
  version: '0'
204
204
  requirements: []
205
- rubygems_version: 3.1.4
205
+ rubygems_version: 3.1.6
206
206
  signing_key:
207
207
  specification_version: 4
208
208
  summary: Ruby wrapper for the Redox Engine API