dtk-common-core 0.5.11 → 0.5.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/dtk-common-core.gemspec +1 -1
- data/lib/dtk-common-core/version.rb +1 -1
- data/lib/response.rb +4 -4
- metadata +4 -5
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
OTYwZThlMWQyNzM3MDE2MTE3Mjg4NTM3MTQwMjBjODY3ODM2ZWJkNg==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
YjZmZDU3YzIwNGYyOTBhYWM1MDA4MmVlNTcwZWM0OWQ3MWQzOTNkOA==
|
|
7
7
|
SHA512:
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
NDdlZGQ0MGVlY2M3Y2JmYWYwZDdlNGIwZTAzNmY1YWY3MmZkYzRkMDRmODM5
|
|
10
|
+
MTZjYmZkZTI4YjgwODQ3MjYyZWQzYTEyZTM3YjZhODA2NTFjNWM3MWMzNWU0
|
|
11
|
+
NDg1ZTM4NGExMGY4YTQ5YTAyNDVjMTQyMThjYWRmM2VjNjg3MDU=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
MmY2N2ZhNDk3NWY3ZDJjMWUwNzg5ZGMwNmZlYjcwYjc2YmE3ZjZiMWU1YTli
|
|
14
|
+
Mjg2MGE0ZTQxNDRlNzAyMDI5ZmVmNmIyNDE1Y2VmMTQ0ZmNiMjQxN2M5M2E3
|
|
15
|
+
MzdlOGFkMGMxM2NmOWI4MGQ0ZGJjNTNjYWM0NjdmYzMyMzQzN2U=
|
data/dtk-common-core.gemspec
CHANGED
|
@@ -4,7 +4,7 @@ require File.expand_path('../lib/dtk-common-core/version', __FILE__)
|
|
|
4
4
|
Gem::Specification.new do |gem|
|
|
5
5
|
gem.authors = ["Rich PELAVIN"]
|
|
6
6
|
gem.email = ["rich@reactor8.com"]
|
|
7
|
-
gem.description = %q{
|
|
7
|
+
gem.description = %q{DTK Common Core is a shared library used by several DTK components.}
|
|
8
8
|
gem.summary = %q{Common libraries used for DTK CLI client.}
|
|
9
9
|
gem.homepage = "https://github.com/rich-reactor8/dtk-common-repo"
|
|
10
10
|
gem.licenses = ["GPL-3.0"]
|
data/lib/response.rb
CHANGED
|
@@ -159,16 +159,16 @@ module DTK
|
|
|
159
159
|
def error_handling(opts={},&block)
|
|
160
160
|
begin
|
|
161
161
|
block.call
|
|
162
|
+
rescue ::RestClient::ResourceNotFound, RestClient::Request::Unauthorized, RestClient::BadRequest,::RestClient::InternalServerError => e
|
|
163
|
+
# with latest set of changes we will consider this as special case since most of legacy code is expecting Response class
|
|
164
|
+
Response.new(StatusField => StatusNotok, ErrorsField => JSON.parse(e.response)['errors'])
|
|
162
165
|
rescue ::RestClient::Forbidden => e
|
|
163
166
|
return error_response({ErrorsSubFieldCode => RestClientErrors[e.class.to_s]||GenericError, ErrorsOriginalException => e},opts) unless e.inspect.to_s.include?("PG::Error")
|
|
164
167
|
|
|
165
168
|
errors = {"code" => "pg_error", "message" => e.inspect.to_s.strip, ErrorsOriginalException => e}
|
|
166
169
|
error_response(errors)
|
|
167
|
-
rescue ::RestClient::ServerBrokeConnection,::RestClient::
|
|
170
|
+
rescue ::RestClient::ServerBrokeConnection,::RestClient::RequestTimeout, Errno::ECONNREFUSED => e
|
|
168
171
|
error_response({ErrorsSubFieldCode => RestClientErrors[e.class.to_s]||GenericError, ErrorsOriginalException => e},opts)
|
|
169
|
-
rescue ::RestClient::ResourceNotFound => e
|
|
170
|
-
errors = {"code" => RestClientErrors[e.class.to_s], "message" => e.to_s, ErrorsOriginalException => e}
|
|
171
|
-
error_response(errors)
|
|
172
172
|
rescue Exception => e
|
|
173
173
|
error_response({ErrorsSubFieldCode => e.class.to_s, ErrorsOriginalException => e},opts)
|
|
174
174
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dtk-common-core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.12
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Rich PELAVIN
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-
|
|
11
|
+
date: 2014-05-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rest-client
|
|
@@ -24,8 +24,7 @@ dependencies:
|
|
|
24
24
|
- - ~>
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: 1.6.7
|
|
27
|
-
description:
|
|
28
|
-
used for http communication.
|
|
27
|
+
description: DTK Common Core is a shared library used by several DTK components.
|
|
29
28
|
email:
|
|
30
29
|
- rich@reactor8.com
|
|
31
30
|
executables: []
|
|
@@ -66,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
66
65
|
version: '0'
|
|
67
66
|
requirements: []
|
|
68
67
|
rubyforge_project:
|
|
69
|
-
rubygems_version: 2.
|
|
68
|
+
rubygems_version: 2.2.2
|
|
70
69
|
signing_key:
|
|
71
70
|
specification_version: 4
|
|
72
71
|
summary: Common libraries used for DTK CLI client.
|