mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:34:31 +08:00
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:
@ -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
|
||||
|
Reference in New Issue
Block a user