FIX: check permalinks for deleted topics

- allow to specify 410 vs 404 in Discourse::NotFound exception
- remove unused `permalink_redirect_or_not_found` which
- handle JS side links to topics via Discourse-Xhr-Redirect mechanism
This commit is contained in:
Sam
2018-08-09 15:05:12 +10:00
parent f7b4a2b3ba
commit ed4c0f256e
7 changed files with 88 additions and 26 deletions

View File

@ -77,7 +77,18 @@ module Discourse
end
# When something they want is not found
class NotFound < StandardError; end
class NotFound < StandardError
attr_reader :status
attr_reader :check_permalinks
attr_reader :original_path
def initialize(message = nil, status: 404, check_permalinks: false, original_path: nil)
@status = status
@check_permalinks = check_permalinks
@original_path = original_path
super(message)
end
end
# When a setting is missing
class SiteSettingMissing < StandardError; end