upland_mobile_commons_rest 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/upland_mobile_commons_rest/errors.rb +8 -0
- data/spec/client_spec.rb +12 -0
- data/upland_mobile_commons_rest.gemspec +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6af9508f63531c934fab5b8d4129d5132609bf316e846cc7dedc02e255b8f809
|
4
|
+
data.tar.gz: 36186a816bdcb8841f48d2f5f9af4c484c0c516af6529b4c255bbac42101b0ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74ac3b2e39fd5e888c4d0b66097dfab977306a23b353a667a9eb5d51df74ac4945542cfd35ea3e951a928dfa45382ab4e280e18e0257bd92cf5d0c19e4bdb270
|
7
|
+
data.tar.gz: 0037b025610ce66dbdb592e8e4b8010085d1c2fc30b9ff0ee3c0cc96b8af00771e04fc5fe0f222dfff756a2061e4eb126eb635238eef967c5c95f67a4f79256b
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
@@ -33,6 +33,12 @@ module UplandMobileCommonsRest
|
|
33
33
|
case status_code
|
34
34
|
when 502
|
35
35
|
raise BadGatewayError.new(response)
|
36
|
+
when 503
|
37
|
+
if /This website is under heavy load/.match?(response.body)
|
38
|
+
raise HeavyLoadError, response.body
|
39
|
+
else
|
40
|
+
raise UnknownError, response.body
|
41
|
+
end
|
36
42
|
when 504
|
37
43
|
raise GatewayTimeoutError.new(response)
|
38
44
|
when 500...600
|
@@ -47,6 +53,8 @@ module UplandMobileCommonsRest
|
|
47
53
|
attr_accessor :code, :raw_message
|
48
54
|
end
|
49
55
|
|
56
|
+
class HeavyLoadError < MobileCommonsError; end
|
57
|
+
|
50
58
|
class UnknownError < MobileCommonsError; end
|
51
59
|
|
52
60
|
class InvalidCampaignId < MobileCommonsError; end
|
data/spec/client_spec.rb
CHANGED
@@ -107,6 +107,18 @@ describe UplandMobileCommonsRest::Client do
|
|
107
107
|
expect(error.to_s).to include(response_body)
|
108
108
|
end
|
109
109
|
end
|
110
|
+
|
111
|
+
context 'with Heavy Load message' do
|
112
|
+
let(:response_body) { "<h2>This website is under heavy load (queue full)</h2><p>We're sorry, too many people are accessing this website at the same time. We're working on this problem. Please try again later.</p>" }
|
113
|
+
|
114
|
+
it 'should raise a HeavyLoadError' do
|
115
|
+
expect do
|
116
|
+
subject.post_request('do_something', request_params)
|
117
|
+
end.to raise_error(UplandMobileCommonsRest::HeavyLoadError) do |error|
|
118
|
+
expect(error.to_s).to include(response_body)
|
119
|
+
end
|
120
|
+
end
|
121
|
+
end
|
110
122
|
end
|
111
123
|
|
112
124
|
context '504 status response' do
|
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: upland_mobile_commons_rest 0.
|
5
|
+
# stub: upland_mobile_commons_rest 0.3.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "upland_mobile_commons_rest".freeze
|
9
|
-
s.version = "0.
|
9
|
+
s.version = "0.3.0"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
13
|
s.authors = ["Kathy Lu".freeze, "Diego Marcet".freeze, "Grey Moore".freeze, "Nathan Woodhull".freeze]
|
14
|
-
s.date = "
|
14
|
+
s.date = "2022-07-05"
|
15
15
|
s.description = "A simple ruby API client gem for the Upland Mobile Commons REST API".freeze
|
16
16
|
s.email = "team@controlshiftlabs.com".freeze
|
17
17
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: upland_mobile_commons_rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kathy Lu
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2022-07-05 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: vertebrae
|