mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
The ability to display errors on flagging actions.
This commit is contained in:
@ -63,9 +63,12 @@ module Discourse
|
||||
|
||||
# When they don't have permission to do something
|
||||
class InvalidAccess < StandardError
|
||||
attr_reader :obj
|
||||
def initialize(msg = nil, obj = nil)
|
||||
attr_reader :obj, :custom_message
|
||||
def initialize(msg = nil, obj = nil, opts = nil)
|
||||
super(msg)
|
||||
|
||||
opts ||= {}
|
||||
@custom_message = opts[:custom_message] if opts[:custom_message]
|
||||
@obj = obj
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user