processout 1.0.12 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/processout/errors/authentication_error.rb +4 -2
- data/lib/processout/errors/generic_error.rb +4 -2
- data/lib/processout/errors/internal_error.rb +4 -2
- data/lib/processout/errors/notfound_error.rb +4 -2
- data/lib/processout/errors/validation_error.rb +4 -2
- data/lib/processout/networking/response.rb +13 -7
- data/lib/processout/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb8788229d045a0326bb2f36bc0200f4b6329ce5
|
4
|
+
data.tar.gz: 04abbbf094057f2842683186332887b43a8d61c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95264089be96d313114a0f363e1c5e3341e9032288a051e4178e95beb56f1b5020333ecebd4544ba9ad4b11343246145e8ede1bcbb7d22bb5b9e39ca0d3b76e4
|
7
|
+
data.tar.gz: 5b83f080072da078affccd9dcc26f59b82e906b95e111adf32a98575566fe1464072cc415631c2298d69b520266172d4469339a2f2307d25723c3d4de33e3f01
|
@@ -26,6 +26,14 @@ module ProcessOut
|
|
26
26
|
false
|
27
27
|
end
|
28
28
|
|
29
|
+
# Code returns the error code contained in the response, if any
|
30
|
+
def code
|
31
|
+
if @body.include? "error_type"
|
32
|
+
return @body["error_type"]
|
33
|
+
end
|
34
|
+
""
|
35
|
+
end
|
36
|
+
|
29
37
|
# Message returns the error message contained in the response, if any
|
30
38
|
def message
|
31
39
|
if @body.include? "message"
|
@@ -39,21 +47,19 @@ module ProcessOut
|
|
39
47
|
def check
|
40
48
|
unless self.success
|
41
49
|
if @status == 404
|
42
|
-
raise NotFoundError, self.message
|
50
|
+
raise NotFoundError.new(self.code, self.message)
|
43
51
|
end
|
44
52
|
if @status == 401
|
45
|
-
raise AuthenticationError, self.message
|
53
|
+
raise AuthenticationError.new(self.code, self.message)
|
46
54
|
end
|
47
55
|
if @status == 400
|
48
|
-
raise ValidationError, self.message
|
56
|
+
raise ValidationError.new(self.code, self.message)
|
49
57
|
end
|
50
58
|
if @status >= 500
|
51
|
-
raise InternalError,
|
52
|
-
@status.to_s + "): " + self.message
|
59
|
+
raise InternalError.new(self.code, self.message)
|
53
60
|
end
|
54
61
|
|
55
|
-
raise GenericError,
|
56
|
-
@status.to_s + "): " + self.message
|
62
|
+
raise GenericError.new(self.code, self.message)
|
57
63
|
end
|
58
64
|
end
|
59
65
|
protected :check
|
data/lib/processout/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: processout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manuel HUEZ
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|