fanforce-errors 0.2 → 0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/fanforce/errors/errors.rb +11 -1
- data/lib/fanforce/errors/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZDQxZWIxNjAxOGU1MTAxZDIwZDJhM2IyZjA4YTI3NDc2YWY3MjdhMQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NDBiMjJhZTFlMzhiMmZmYjg2ZWEyMTY2YTE3NmZiM2QwOTRhOGFjMQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YmNhYTkwZjU1ZTNlZTI4MmY3NDM0ODYyMjllZTg0ZTRkYmUyNzM4MzU0MjI3
|
10
|
+
OTBjZWM1YmFmYmQzNzcyMzRlZmQ2NDdiMGUyNmQ0ZDAzNjhhOGQwNzhiOWJm
|
11
|
+
ZWRkYjkzYmNmYmQwMjVhYjYzMDk0NjY3YjJiMGVkNzMwNWZhMDU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NGU4NWQ3ZjViNzgwYTIyZGQwODRjMTc3MzVlYmRmZjE1YjQ0MjQyMmNjMWRl
|
14
|
+
ZmUzZWZkYjc0MjBlZTUxNTRiZGU2NGMzYTA3ZDQ3OTJkZjE0NDZlNzI1ODE2
|
15
|
+
ODFiODEzNzc0YjQxN2FiNGI4ZDUxYjc3MzZjMDEyMzc0NzI5NTA=
|
@@ -14,7 +14,7 @@ class Fanforce::Error < StandardError
|
|
14
14
|
end
|
15
15
|
@public_errors = format_errors(errors)
|
16
16
|
@env = Fanforce.env
|
17
|
-
super(
|
17
|
+
super("#{@public_errors[0].to_json}")
|
18
18
|
end
|
19
19
|
|
20
20
|
def format_errors(raw_errors)
|
@@ -70,6 +70,16 @@ class Fanforce::Error::NotFound < Fanforce::Error # Method or record could not b
|
|
70
70
|
def default_message; 'Not Found' end
|
71
71
|
def valid_error_codes; [:record_not_found, :method_not_found] end
|
72
72
|
def default_error_code; :unknown end
|
73
|
+
def initialize(*args)
|
74
|
+
if args[0].is_a?(Hash)
|
75
|
+
super(*args)
|
76
|
+
else
|
77
|
+
super(
|
78
|
+
resource: args[0].to_s.demodulize.singularize,
|
79
|
+
message: args[1]
|
80
|
+
)
|
81
|
+
end
|
82
|
+
end
|
73
83
|
end
|
74
84
|
|
75
85
|
class Fanforce::Error::RequestFailed < Fanforce::Error # Request has correct fields but failed for another reason
|