fanforce-internal-errors 0.1.3 → 0.1.4
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 +10 -10
- 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
|
+
ZDVhMWM1OGIzNTg3NzM0OGY4YmEzOWFjZGM4Y2JiZDA3MWRjODI1Nw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OTdlYzNjOTI5MWY1Y2NjOTIzODcwMzFkNzlmODI5MDUxZDc1ZjIyZg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZTA2OTUyYjgzOTA2NWE1NDZkMGQ5NGQ4ODlmYzRiZmQ5NDYyMDA1YzkyYTM4
|
10
|
+
ZDQyY2JhNGY5NWRiNDRjNzdkYTIyNzM1YjA0MmQ4OTA3MTBlOTA5YjRjMTVj
|
11
|
+
MjAwMDkwYjA0MDExYWMxOGQyMGYzMDNjZjRlYjIzZGNiMzAzMWE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NDk4YzEwNzk0ZjM4MDgxNjM5ZDc5Y2E0MDdmOTRmMTkxZDI4ZDViOWRjNmQ4
|
14
|
+
ZWU4MDlmNmYxYjljOTJkNjMwYTJkZmI1OWYxYTliMmFkZmNjMDNkZGVmMTNj
|
15
|
+
NjUyYmU4NTlmZDQxZjI0YmY1ZWM5NmY0MmViZDkxZDE2ZGQyZWY=
|
@@ -44,9 +44,9 @@ class Fanforce::Error < StandardError
|
|
44
44
|
|
45
45
|
end
|
46
46
|
|
47
|
-
class Fanforce::Error::
|
47
|
+
class Fanforce::Error::BadRequest < Fanforce::Error # Request is missing something or invalid
|
48
48
|
def code; 400 end
|
49
|
-
def default_message; '
|
49
|
+
def default_message; 'Bad Request' end
|
50
50
|
def valid_error_codes; [:blank_field, :missing_field, :invalid_association, :invalid_field] end
|
51
51
|
def default_error_code; :unknown end
|
52
52
|
end
|
@@ -138,14 +138,14 @@ end
|
|
138
138
|
module Fanforce::Errors
|
139
139
|
def self.included(base) base.extend(self) end
|
140
140
|
|
141
|
-
|
142
|
-
Unauthorized
|
143
|
-
Forbidden
|
144
|
-
NotFound
|
145
|
-
RequestFailed
|
146
|
-
InternalError
|
147
|
-
WebhookFailed
|
148
|
-
AddonFailed
|
141
|
+
BadRequest = Fanforce::Error::BadRequest
|
142
|
+
Unauthorized = Fanforce::Error::Unauthorized
|
143
|
+
Forbidden = Fanforce::Error::Forbidden
|
144
|
+
NotFound = Fanforce::Error::NotFound
|
145
|
+
RequestFailed = Fanforce::Error::RequestFailed
|
146
|
+
InternalError = Fanforce::Error::InternalError
|
147
|
+
WebhookFailed = Fanforce::Error::WebhookFailed
|
148
|
+
AddonFailed = Fanforce::Error::AddonFailed
|
149
149
|
|
150
150
|
def self.format_admin_details(e, errors=[], additional_options={})
|
151
151
|
admin_details = {error_class: e.class.name, public_response: errors}
|