mirror of
https://github.com/varvet/pundit.git
synced 2022-11-09 12:30:11 -05:00
all Punit errors extend Punit::Error
This commit is contained in:
parent
73ec66be01
commit
a21ad899a7
1 changed files with 4 additions and 3 deletions
|
@ -9,7 +9,8 @@ require "active_support/dependencies/autoload"
|
||||||
module Pundit
|
module Pundit
|
||||||
SUFFIX = "Policy"
|
SUFFIX = "Policy"
|
||||||
|
|
||||||
class NotAuthorizedError < StandardError
|
class Error < StandardError; end
|
||||||
|
class NotAuthorizedError < Error
|
||||||
attr_reader :query, :record, :policy
|
attr_reader :query, :record, :policy
|
||||||
|
|
||||||
def initialize(options = {})
|
def initialize(options = {})
|
||||||
|
@ -22,9 +23,9 @@ module Pundit
|
||||||
super(message)
|
super(message)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
class AuthorizationNotPerformedError < StandardError; end
|
class AuthorizationNotPerformedError < Error; end
|
||||||
class PolicyScopingNotPerformedError < AuthorizationNotPerformedError; end
|
class PolicyScopingNotPerformedError < AuthorizationNotPerformedError; end
|
||||||
class NotDefinedError < StandardError; end
|
class NotDefinedError < Error; end
|
||||||
|
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue