2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2016-06-30 08:24:03 +00:00
|
|
|
module Exceptions
|
|
|
|
|
|
|
|
class NotAuthorized < StandardError; end
|
2020-11-24 16:20:57 +00:00
|
|
|
|
2021-02-04 08:28:41 +00:00
|
|
|
class Forbidden < StandardError; end
|
|
|
|
|
2016-06-30 08:24:03 +00:00
|
|
|
class UnprocessableEntity < StandardError; end
|
|
|
|
|
2021-12-13 06:59:20 +00:00
|
|
|
class ApplicationModel < UnprocessableEntity
|
|
|
|
attr_reader :record
|
|
|
|
|
|
|
|
def initialize(record, message)
|
|
|
|
super(message)
|
|
|
|
@record = record
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2021-07-23 13:07:16 +00:00
|
|
|
def self.policy_class
|
|
|
|
ExceptionsPolicy
|
|
|
|
end
|
|
|
|
|
2016-06-30 08:24:03 +00:00
|
|
|
end
|