1
0
Fork 0
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:
Thu Trang Pham 2015-04-07 14:46:50 -04:00
parent 73ec66be01
commit a21ad899a7

View file

@ -9,7 +9,8 @@ require "active_support/dependencies/autoload"
module Pundit
SUFFIX = "Policy"
class NotAuthorizedError < StandardError
class Error < StandardError; end
class NotAuthorizedError < Error
attr_reader :query, :record, :policy
def initialize(options = {})
@ -22,9 +23,9 @@ module Pundit
super(message)
end
end
class AuthorizationNotPerformedError < StandardError; end
class AuthorizationNotPerformedError < Error; end
class PolicyScopingNotPerformedError < AuthorizationNotPerformedError; end
class NotDefinedError < StandardError; end
class NotDefinedError < Error; end
extend ActiveSupport::Concern