active-campaign-simple 0.3.3a → 0.3.3b

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: b1529b5e051327dced3e02225047ecf1c6c296157ccba72769fe97d095cc6e71
4
- data.tar.gz: 34a7a8975cc59d96d29a3b05c8597e48f5caf582befe90ca482f9ce0ed1001fa
3
+ metadata.gz: 39fc1fed772ae97290b45b98ba305792f6d5f0897709c04250ecc1f9e821c811
4
+ data.tar.gz: c1ac9a3101dbffd599205646531f53164094b1cb38eab55c8937089219aff6b2
5
5
  SHA512:
6
- metadata.gz: a92a600af9984c0112c689056b0ef4730df5a5b03b974a0d83678ece293dd87d7c087ae9091e78e4f3f4bd924e0e35380ba76dd3c649a3f3e8fadf8ea13c1813
7
- data.tar.gz: 6efab749c68d3e42de5f94bc8837e3058206f480527d5183717f9f64cc942a2fe7bfdce0598658635de66ced4260b98a93803d09c74450580f18e4804acbf92d
6
+ metadata.gz: c4435b32465131714636992e5971939937257cccc44e3d953032c6e244edfe55c6db738420fda7c8cdabc3cf03c83f3f251df438400624783254f7d6bb3808dd
7
+ data.tar.gz: 39ac549329357b245fcb1cb3534464a85518cca129048a9c1a76768557762eead8ab34d9ccfc1a2e1b9ecea4dd404a12b8e2b0a9e5298c70646cdb4d86189bfd
@@ -2,20 +2,18 @@ require 'active-campaign-simple/exceptions'
2
2
 
3
3
  module ActiveCampaign
4
4
  class ExceptionHandler
5
-
6
5
  ERRORS = {
7
6
  '404 Not Found' => ActiveCampaign::NotFoundError,
8
7
  '422 Unprocessable Entity' => ActiveCampaign::UnprocessableEntityError
9
8
  }
10
9
 
11
10
  def initialize(error)
12
- error_class = ERRORS[error.message]
11
+ error_class = ERRORS.find { |status, _| error.message.start_with?(status) }&.last
13
12
  if error_class
14
- raise error_class.new(error)
13
+ raise error_class.new(error), "#{error.message}\nResponse body:\n#{error.response&.body}\nStack trace:\n#{error.backtrace.join("\n")}"
15
14
  else
16
- raise ActiveCampaign::APIError.new(error)
15
+ raise ActiveCampaign::APIError.new(error), "#{error.message}\nResponse body:\n#{error.response&.body}\nStack trace:\n#{error.backtrace.join("\n")}"
17
16
  end
18
17
  end
19
-
20
18
  end
21
- end
19
+ end
@@ -1,4 +1,4 @@
1
1
  module ActiveCampaign
2
2
  # The version of the gem
3
- VERSION = '0.3.3a'.freeze unless defined?(::ActiveCampaign::VERSION)
3
+ VERSION = '0.3.3b'.freeze unless defined?(::ActiveCampaign::VERSION)
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active-campaign-simple
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3a
4
+ version: 0.3.3b
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Leavitt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-05 00:00:00.000000000 Z
11
+ date: 2023-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake