mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 09:10:25 +08:00
The ability to display errors on flagging actions.
This commit is contained in:
parent
e809996c2a
commit
d1ebc62065
7 changed files with 50 additions and 15 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue