platanus 0.0.27 → 0.0.28

Sign up to get free protection for your applications and to get access to all the features.
@@ -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 (of course)
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
@@ -7,7 +7,6 @@ module Platanus
7
7
  # User profiling and authorization module
8
8
  module Canned2
9
9
 
10
- class Interrupt < Exception; end
11
10
  class Error < StandardError; end
12
11
  class AuthError < Error; end
13
12
  class SetupError < Error; end
@@ -1,3 +1,3 @@
1
1
  module Platanus
2
- VERSION = "0.0.27" # 0.1 will come with tests!
2
+ VERSION = "0.0.28" # 0.1 will come with tests!
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: platanus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.27
4
+ version: 0.0.28
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: