ctws 0.2.2.beta → 0.2.3.beta
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/app/controllers/concerns/ctws/exception_handler.rb +13 -5
- data/lib/ctws/version.rb +4 -1
- data/spec/dummy/log/test.log +0 -31496
- metadata +54 -56
- data/spec/dummy/db/test.sqlite3 +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5af5f02fa153385302590528d21f68762a075693e5689e357852d3837dc12333
|
4
|
+
data.tar.gz: 422db50de1bef22b0748aaeb7742fa5542bc6734d89d5f058f24eb453c7a1163
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 102b91e2b6ed522f794f46d1b8ad6d6c936a2a87fad44df579b31b7155528095386287eee3d7fdb1e5c145a8d0b804fd0a0d5ab7e1d36191734aba5f9b314767
|
7
|
+
data.tar.gz: fd55fccf6a9ee52c08798a6defe6b4d17467a64f80d2ee0abd3afa3238f1725aab72a112266ac6c634b696dd6843a4dbf67f4bf33818959e3ccd31a452232471
|
@@ -40,26 +40,34 @@ module Ctws
|
|
40
40
|
|
41
41
|
# JSON response with message; Status code 401 - Unauthorized
|
42
42
|
def unauthorized_request(e)
|
43
|
-
json_response(
|
43
|
+
json_response(error_response_params(e, 401), :unauthorized)
|
44
44
|
end
|
45
45
|
|
46
46
|
# JSON response with message; Status code 404 - Not Found
|
47
47
|
def not_found(e)
|
48
|
-
json_response(
|
48
|
+
json_response(error_response_params(e, 404), :not_found)
|
49
49
|
end
|
50
50
|
|
51
51
|
def not_confirmed(e)
|
52
|
-
json_response(
|
52
|
+
json_response(error_response_params(e, 403), :unauthorized)
|
53
53
|
end
|
54
54
|
|
55
55
|
# JSON response with message; Status code 422 - unprocessable entity
|
56
56
|
def four_twenty_two(e)
|
57
|
-
json_response(
|
57
|
+
json_response(error_response_params(e, 422), :unprocessable_entity)
|
58
58
|
end
|
59
59
|
|
60
60
|
# JSON response with message; Status code 498 - Invalid Token
|
61
61
|
def four_ninety_eight(e)
|
62
|
-
json_response(
|
62
|
+
json_response(error_response_params(e, 498), :invalid_token)
|
63
|
+
end
|
64
|
+
|
65
|
+
#------------------------------------------------------
|
66
|
+
private
|
67
|
+
#------------------------------------------------------
|
68
|
+
|
69
|
+
def error_response_params(exception, error_code)
|
70
|
+
[{ message: exception.message, error_code: error_code, data: exception.backtrace}]
|
63
71
|
end
|
64
72
|
|
65
73
|
end
|
data/lib/ctws/version.rb
CHANGED