Allow NotFound to specify an optional Location for the resource

This commit is contained in:
Robin Ward
2017-09-26 09:09:48 -04:00
parent 367fb1c524
commit 4ae66c9e01
2 changed files with 25 additions and 3 deletions

View File

@ -74,7 +74,13 @@ module Discourse
end
# When something they want is not found
class NotFound < StandardError; end
class NotFound < StandardError
attr_reader :location
def initialize(opts = nil)
opts ||= {}
@location = opts[:location]
end
end
# When a setting is missing
class SiteSettingMissing < StandardError; end