exceptions.rb 453 B

123456789101112131415161718192021222324
  1. # Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
  2. module Exceptions
  3. class NotAuthorized < StandardError; end
  4. class Forbidden < StandardError; end
  5. class UnprocessableEntity < StandardError; end
  6. class ApplicationModel < UnprocessableEntity
  7. attr_reader :record
  8. def initialize(record, message)
  9. super(message)
  10. @record = record
  11. end
  12. end
  13. def self.policy_class
  14. ExceptionsPolicy
  15. end
  16. end