cirro-ruby-client 2.5.17 → 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: af73a08b3f4f34e06c352bc87a47d7b0dfa0e9bf463247dd51aea9d98ff21c7c
4
- data.tar.gz: 800a36269038dbd59c553ce3a21f5183c433676e3589fa73fc4667918e36426a
3
+ metadata.gz: 3648839ab1f56e097e5808947ec9c89fc0b9d8761435f7d557a6134d6982122a
4
+ data.tar.gz: eeb647f8aed3277b5ac80ac42042841a7b86d568a509bd80fef2e031684b27b3
5
5
  SHA512:
6
- metadata.gz: a0968338da2cbf0868567ecd43e82352b734636bde05dc2db40d738c66d1d44d83157f19e3be139711607d4fe52f5165e3c9e467e9925fec97b487d27c58e1ed
7
- data.tar.gz: 727bb5ef38e61a81075b2fbb3208e141785e733bb2a5b78c3093628fdd520d6200f5bc379f019577eccdaa87ed25184de2380bd3960e52a24193702f2e6e4f5a
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.5.17)
4
+ cirro-ruby-client (2.6.1)
5
5
  activesupport
6
6
  faraday (< 1.2.0)
7
7
  faraday_middleware
@@ -11,11 +11,9 @@ PATH
11
11
  GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
- activemodel (7.1.0)
15
- activesupport (= 7.1.0)
16
- activesupport (7.1.0)
17
- base64
18
- bigdecimal
14
+ activemodel (7.0.6)
15
+ activesupport (= 7.0.6)
16
+ activesupport (7.0.6)
19
17
  concurrent-ruby (~> 1.0, >= 1.0.2)
20
18
  connection_pool (>= 2.2.5)
21
19
  drb
@@ -54,7 +52,7 @@ GEM
54
52
  rack (>= 0.2)
55
53
  jwt (2.7.1)
56
54
  method_source (1.0.0)
57
- minitest (5.20.0)
55
+ minitest (5.19.0)
58
56
  multipart-post (2.3.0)
59
57
  mutex_m (0.1.2)
60
58
  parallel (1.19.2)
@@ -1,7 +1,7 @@
1
1
  # rubocop:disable Style/MutableConstant
2
2
  module CirroIO
3
3
  module Client
4
- VERSION = '2.5.17'
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'
@@ -33,7 +34,7 @@ module CirroIOV2
33
34
  attr_reader :options
34
35
 
35
36
  DEFAULT_OPTIONS = {
36
- site: 'https://api.cirro.io',
37
+ site: 'https://cirro.io/api',
37
38
  api_version: 'v2',
38
39
  auth_type: :jwt,
39
40
  }.freeze
@@ -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.5.17
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-10-13 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