mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
simplify catch for custom domain resolv issues
This commit is contained in:
parent
3fcbb116fe
commit
2aa30eaa28
1 changed files with 1 additions and 11 deletions
|
@ -155,17 +155,7 @@ post '/settings/:username/custom_domain' do
|
|||
begin
|
||||
Socket.gethostbyname @site.values[:domain]
|
||||
rescue SocketError, ResolutionError => e
|
||||
if e.message =~ /name or service not known/i
|
||||
flash[:error] = 'Domain needs to be valid and already registered.'
|
||||
redirect "/settings/#{@site.username}#custom_domain"
|
||||
elsif e.message =~ /No address associated with hostname/i
|
||||
#flash[:error] = "The domain isn't setup to use Neocities yet, cannot add. Please make the A and CNAME record changes where you registered your domain."
|
||||
#redirect "/settings/#{@site.username}#custom_domain"
|
||||
else
|
||||
raise e
|
||||
end
|
||||
rescue Socket::ResolutionError
|
||||
flash[:error] = 'Temporary failure in name resolution, please try again later.'
|
||||
flash[:error] = "The domain isn't setup to use Neocities yet, cannot add. Please make the A and CNAME record changes where you registered your domain."
|
||||
redirect "/settings/#{@site.username}#custom_domain"
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue