mirror of
https://github.com/zammad/zammad
synced 2026-05-24 09:48:36 +00:00
42 lines
799 B
Ruby
42 lines
799 B
Ruby
# Copyright (C) 2012-2025 Zammad Foundation, https://zammad-foundation.org/
|
|
|
|
module Exceptions
|
|
|
|
class NotAuthorized < StandardError; end
|
|
|
|
class Forbidden < StandardError; end
|
|
|
|
class UnprocessableEntity < StandardError; end
|
|
|
|
class InvalidAttribute < StandardError
|
|
attr_reader :attribute
|
|
|
|
def initialize(attribute, message)
|
|
super(message)
|
|
@attribute = attribute
|
|
end
|
|
end
|
|
|
|
class MissingAttribute < StandardError
|
|
attr_reader :attribute
|
|
|
|
def initialize(attribute, message)
|
|
super(message)
|
|
@attribute = attribute
|
|
end
|
|
end
|
|
|
|
class ApplicationModel < UnprocessableEntity
|
|
attr_reader :record
|
|
|
|
def initialize(record, message)
|
|
super(message)
|
|
@record = record
|
|
end
|
|
end
|
|
|
|
def self.policy_class
|
|
ExceptionsPolicy
|
|
end
|
|
|
|
end
|