active-campaign-simple 0.3.3 → 0.4.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a2d4199c7dbf5e9d665a353d8b70497b9f4b598e56b8bd5e70aa5a4fc839417
|
4
|
+
data.tar.gz: 1de93fb262ee19f2cacbd432bbb00901b28969618d14e8adc67fdb685c00b51b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a9a504fdcfb782ddb7dffd02a61e9ece8291c81091d5ff72505a0758097deb505db43fd611cec735c1a46936e4fdbddf80e452500ee4b6db92347612ac3de60
|
7
|
+
data.tar.gz: 782937abd3d7e34f9864229c84fb042e70c49ec1c89630bd29bee55dd9a05dd1fc6f1f0a3d0d56f23d5848afe92bde40e5a5d7712938798dcbc1785789a1a6b8
|
@@ -11,8 +11,7 @@ module ActiveCampaign
|
|
11
11
|
key: key,
|
12
12
|
actid: actid,
|
13
13
|
event: event,
|
14
|
-
|
15
|
-
visit: { email: email }
|
14
|
+
visit: URI.encode_www_form_component("{\"email\":\"#{email}\"}")
|
16
15
|
}
|
17
16
|
form.merge!({ eventdata: eventdata }) if eventdata
|
18
17
|
|
@@ -2,19 +2,18 @@ require 'active-campaign-simple/exceptions'
|
|
2
2
|
|
3
3
|
module ActiveCampaign
|
4
4
|
class ExceptionHandler
|
5
|
-
|
6
5
|
ERRORS = {
|
7
|
-
'404 Not Found' => ActiveCampaign::NotFoundError
|
6
|
+
'404 Not Found' => ActiveCampaign::NotFoundError,
|
7
|
+
'422 Unprocessable Entity' => ActiveCampaign::UnprocessableEntityError
|
8
8
|
}
|
9
9
|
|
10
10
|
def initialize(error)
|
11
|
-
error_class = ERRORS
|
11
|
+
error_class = ERRORS.find { |status, _| error.message.start_with?(status) }&.last
|
12
12
|
if error_class
|
13
|
-
raise error_class.new(error)
|
13
|
+
raise error_class.new(error), "#{error.message}\nResponse body:\n#{error.response&.body}\n"
|
14
14
|
else
|
15
|
-
raise ActiveCampaign::APIError.new(error)
|
15
|
+
raise ActiveCampaign::APIError.new(error), "#{error.message}\nResponse body:\n#{error.response&.body}\n"
|
16
16
|
end
|
17
17
|
end
|
18
|
-
|
19
18
|
end
|
20
|
-
end
|
19
|
+
end
|
@@ -1,11 +1,14 @@
|
|
1
1
|
class ActiveCampaignAPIError < ::StandardError
|
2
2
|
def initialize(error)
|
3
|
-
|
3
|
+
stack = "ERROR: #{error}\n"
|
4
|
+
stack += error.backtrace.join("\n") if error.backtrace
|
5
|
+
ActiveCampaign.api_logger.error stack
|
4
6
|
super(error)
|
5
7
|
end
|
6
8
|
end
|
7
9
|
|
8
10
|
module ActiveCampaign
|
9
11
|
class NotFoundError < ActiveCampaignAPIError; end
|
12
|
+
class UnprocessableEntityError < ActiveCampaignAPIError; end
|
10
13
|
class APIError < ActiveCampaignAPIError; end
|
11
14
|
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.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Leavitt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
78
|
- !ruby/object:Gem::Version
|
79
79
|
version: 3.0.0
|
80
80
|
requirements: []
|
81
|
-
rubygems_version: 3.
|
81
|
+
rubygems_version: 3.5.6
|
82
82
|
signing_key:
|
83
83
|
specification_version: 4
|
84
84
|
summary: Simple Ruby REST wrapper for the ActiveCampaign API
|