dtk-common-core 0.5.11 → 0.5.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZjY3NTI2MDczZjQ3OGE5Yzc4ZGM1ZDJiNGY0YmM1ZTZmOWY5NTVkOQ==
4
+ OTYwZThlMWQyNzM3MDE2MTE3Mjg4NTM3MTQwMjBjODY3ODM2ZWJkNg==
5
5
  data.tar.gz: !binary |-
6
- ODdhZmI5OTI5NDhlYzY0YzQ1NWEwOGY1Mjc0YTUwY2QxNzkzYjIzNg==
6
+ YjZmZDU3YzIwNGYyOTBhYWM1MDA4MmVlNTcwZWM0OWQ3MWQzOTNkOA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- Mjk0YmQ5NTg0NGQwNTA2YjFlY2U5NjAxMjQ3ZGFlMWUxOWU2MDRmODM3YjI3
10
- MzVjYTUzY2VlN2VhZGUxZDNlZjA5Mjg4YjcxNjhlNzRlYTU5OTNiZjZhOTJl
11
- NzE3YzdiYTdmMDgyMDMxNGRkZjVmYTVjYTc1MzNkN2E1YzA0YWE=
9
+ NDdlZGQ0MGVlY2M3Y2JmYWYwZDdlNGIwZTAzNmY1YWY3MmZkYzRkMDRmODM5
10
+ MTZjYmZkZTI4YjgwODQ3MjYyZWQzYTEyZTM3YjZhODA2NTFjNWM3MWMzNWU0
11
+ NDg1ZTM4NGExMGY4YTQ5YTAyNDVjMTQyMThjYWRmM2VjNjg3MDU=
12
12
  data.tar.gz: !binary |-
13
- NWU5MjlhYjg2NWJkZDY2MmZmYTRiM2UzNjc2NDcxNTUyNjgzMzZjNDQ1Njhl
14
- NjdjZDAzZGY3ZjhlYTgwZTliODE3OGY3MGNiYWQ1YWM3MWUxNmViODQ0ZTUw
15
- NTlkNDNhN2UxYjRiYjExYzc2YjUzNDlhNDdlNjhmMjZkNTkzYmY=
13
+ MmY2N2ZhNDk3NWY3ZDJjMWUwNzg5ZGMwNmZlYjcwYjc2YmE3ZjZiMWU1YTli
14
+ Mjg2MGE0ZTQxNDRlNzAyMDI5ZmVmNmIyNDE1Y2VmMTQ0ZmNiMjQxN2M5M2E3
15
+ MzdlOGFkMGMxM2NmOWI4MGQ0ZGJjNTNjYWM0NjdmYzMyMzQzN2U=
@@ -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{Dtk common repo is core common librabry of dtk, and mostly hold libraries used for http communication.}
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"]
@@ -1,3 +1,3 @@
1
1
  module DtkCommonCore
2
- VERSION = "0.5.11"
2
+ VERSION = "0.5.12"
3
3
  end
@@ -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::InternalServerError,::RestClient::RequestTimeout,RestClient::Request::Unauthorized, Errno::ECONNREFUSED => e
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.11
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-04-08 00:00:00.000000000 Z
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: Dtk common repo is core common librabry of dtk, and mostly hold libraries
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.1.9
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.