platanus 0.0.27 → 0.0.28
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/platanus/api_base.rb +6 -1
- data/lib/platanus/canned2.rb +0 -1
- data/lib/platanus/version.rb +1 -1
- metadata +1 -1
data/lib/platanus/api_base.rb
CHANGED
@@ -35,11 +35,16 @@ module Platanus
|
|
35
35
|
api_respond_error(:bad_request, { msg: 'invalid_attributes', errors: exc.record.errors } )
|
36
36
|
end
|
37
37
|
|
38
|
-
# Platanus error support
|
38
|
+
# Platanus error support
|
39
39
|
base.rescue_from 'Platanus::StatusError' do |exc|
|
40
40
|
api_respond_error(exc.status, { msg: exc.message })
|
41
41
|
end
|
42
42
|
|
43
|
+
# Canned error support
|
44
|
+
base.rescue_from 'Platanus::Canned2::AuthError' do |exc|
|
45
|
+
api_respond_error(:unauthorized, { msg: 'canned' })
|
46
|
+
end
|
47
|
+
|
43
48
|
base.extend ClassMethods
|
44
49
|
base.send :include, InstanceMethods
|
45
50
|
end
|
data/lib/platanus/canned2.rb
CHANGED
data/lib/platanus/version.rb
CHANGED