The ability to display errors on flagging actions.

This commit is contained in:
Robin Ward
2017-09-23 10:39:58 -04:00
parent e809996c2a
commit d1ebc62065
7 changed files with 50 additions and 15 deletions

View File

@ -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