mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 14:12:10 +08:00
DEV: rescues site setting missing exception (#13022)
This will allow to correctly catch it client side and display a correct error.
This commit is contained in:
@ -152,6 +152,10 @@ class ApplicationController < ActionController::Base
|
|||||||
render_json_error e.message, status: 400
|
render_json_error e.message, status: 400
|
||||||
end
|
end
|
||||||
|
|
||||||
|
rescue_from Discourse::SiteSettingMissing do |e|
|
||||||
|
render_json_error I18n.t('site_setting_missing', name: e.message), status: 500
|
||||||
|
end
|
||||||
|
|
||||||
rescue_from ActionController::RoutingError, PluginDisabled do
|
rescue_from ActionController::RoutingError, PluginDisabled do
|
||||||
rescue_discourse_actions(:not_found, 404)
|
rescue_discourse_actions(:not_found, 404)
|
||||||
end
|
end
|
||||||
|
@ -3940,6 +3940,8 @@ en:
|
|||||||
page_forbidden:
|
page_forbidden:
|
||||||
title: "Oops! That page is private."
|
title: "Oops! That page is private."
|
||||||
|
|
||||||
|
site_setting_missing: "`%{name}` site setting has to be set."
|
||||||
|
|
||||||
page_not_found:
|
page_not_found:
|
||||||
title: "Oops! That page doesn’t exist or is private."
|
title: "Oops! That page doesn’t exist or is private."
|
||||||
popular_topics: "Popular"
|
popular_topics: "Popular"
|
||||||
|
Reference in New Issue
Block a user