Show severe error for missing forced error, but don't crash

This commit is contained in:
md_5 2013-12-20 18:57:13 +11:00
parent b713ccff10
commit f7d3dfd61d

View File

@ -112,7 +112,10 @@ public class Configuration implements ProxyConfig
Preconditions.checkArgument( servers.containsKey( listener.getFallbackServer() ), "Fallback server %s is not defined", listener.getFallbackServer() ); Preconditions.checkArgument( servers.containsKey( listener.getFallbackServer() ), "Fallback server %s is not defined", listener.getFallbackServer() );
for ( String server : listener.getForcedHosts().values() ) for ( String server : listener.getForcedHosts().values() )
{ {
Preconditions.checkArgument( servers.containsKey( server ), "Forced host server %s is not defined", server ); if ( !servers.containsKey( server ) )
{
ProxyServer.getInstance().getLogger().log( Level.SEVERE, "Forced host server {0} is not defined", server );
}
} }
} }
} }