Exceptions we use in the app should inherit off StandardError

This commit is contained in:
Sam
2015-03-23 12:16:21 +11:00
parent 24e4808aeb
commit 23ed7e9db8
2 changed files with 15 additions and 11 deletions

View File

@ -1,4 +1,8 @@
if SiteSetting.notification_email == SiteSetting.defaults[:notification_email]
# don't crash for invalid hostname, which is possible in dev
SiteSetting.notification_email = "noreply@#{Discourse.current_hostname}" rescue nil
begin
SiteSetting.notification_email = "noreply@#{Discourse.current_hostname}"
rescue Discourse::InvalidParameters
STDERR.puts "Discourse hostname: #{Discourse.current_hostname} is not a valid domain for emails!"
end
end