cirro-ruby-client 2.6.0 → 2.6.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
  SHA256:
3
- metadata.gz: 93e1ca8595f2f1ff48cc01d83faa7be967f4797cf33dc4f6c6ad203797cee42a
4
- data.tar.gz: 4d51c8839890602de955cbca846c15fabc90ad0d99d13917ff42d213b8833d1a
3
+ metadata.gz: 3648839ab1f56e097e5808947ec9c89fc0b9d8761435f7d557a6134d6982122a
4
+ data.tar.gz: eeb647f8aed3277b5ac80ac42042841a7b86d568a509bd80fef2e031684b27b3
5
5
  SHA512:
6
- metadata.gz: 2adc621e4ef3438f5b6b8d44abc5d6f8dae9f38b71d4e6222931d8c7dd9cf7940a33d82e83712198a624a04d8f1f7f674a4c00ebc691a8a14e00d48492d0cf0f
7
- data.tar.gz: 6a060fd02e69e0bfbc3fd7be45305a9748b22f8af21e2142928d18a20a8e2aa41e40788e4d043a2e62f181d76ac1c245721144fd208383bc8592c41d39c53c9a
6
+ metadata.gz: 713cd914e95f804ed04c98bca0ef97c2d0d92ec52ba71d9be8e006a790bbdbdff9a40600b382b0e6bf734c7889b50f52f3b78dc552e6c2e339a187628748d2bb
7
+ data.tar.gz: 7589640cb2517d06a0d209e0eda8e457e8edd8ab631814971cb3584e71d9d45413633dc23eaec93f15d97baa5997b7662a6d95a81816fa60f75db0d6893c7b00
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cirro-ruby-client (2.6.0)
4
+ cirro-ruby-client (2.6.1)
5
5
  activesupport
6
6
  faraday (< 1.2.0)
7
7
  faraday_middleware
@@ -1,7 +1,7 @@
1
1
  # rubocop:disable Style/MutableConstant
2
2
  module CirroIO
3
3
  module Client
4
- VERSION = '2.6.0'
4
+ VERSION = '2.6.1'
5
5
  end
6
6
  end
7
7
  # rubocop:enable Style/MutableConstant
@@ -1,6 +1,7 @@
1
1
  require 'cirro_io/client/version'
2
2
  require 'cirro_io_v2/errors/http_error'
3
3
  require 'cirro_io_v2/errors/response_not_json_error'
4
+ require 'cirro_io_v2/errors/client_error'
4
5
 
5
6
  require 'cirro_io_v2/request_clients/base'
6
7
  require 'cirro_io_v2/request_clients/jwt'
@@ -0,0 +1,29 @@
1
+ require 'forwardable'
2
+
3
+ module CirroIOV2
4
+ module Errors
5
+ class ClientError < StandardError
6
+ extend Forwardable
7
+
8
+ def_instance_delegators :@faraday_error, :response, :full_message
9
+
10
+ attr_reader :faraday_error
11
+
12
+ # this error class is intended to be used ONLY for 4xx errors
13
+ # https://www.rubydoc.info/github/lostisland/faraday/Faraday/ClientError
14
+
15
+ def initialize(faraday_error)
16
+ @faraday_error = faraday_error
17
+ end
18
+
19
+ def message
20
+ puts faraday_error.response.inspect
21
+ faraday_error.response.then do |response|
22
+ return response.inspect if ENV.fetch('DEBUG_CIRRO_RUBY_CLIENT', false)
23
+
24
+ faraday_error.response[:body].presence || faraday_error.try[:message]
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -11,6 +11,8 @@ module CirroIOV2
11
11
  response
12
12
  rescue Faraday::ParsingError => e
13
13
  raise Errors::ResponseNotJsonError, e
14
+ rescue Faraday::ClientError => e
15
+ raise Errors::ClientError, e
14
16
  end
15
17
 
16
18
  def make_request(*args)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cirro-ruby-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cirro Dev Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-17 00:00:00.000000000 Z
11
+ date: 2023-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -122,6 +122,7 @@ files:
122
122
  - lib/cirro_io/client/version.rb
123
123
  - lib/cirro_io/client/worker_filter.rb
124
124
  - lib/cirro_io_v2/client.rb
125
+ - lib/cirro_io_v2/errors/client_error.rb
125
126
  - lib/cirro_io_v2/errors/http_error.rb
126
127
  - lib/cirro_io_v2/errors/response_not_json_error.rb
127
128
  - lib/cirro_io_v2/request_clients/base.rb