{
boolean process = true;
for ( Entry<String, ? extends DownloadErrorPolicy> entry : policies.entrySet() )
{
String key = entry.getKey();
DownloadErrorPolicy policy = entry.getValue();
String defaultSetting = policy.getDefaultOption();
String setting = StringUtils.defaultString( settings.get( key ), defaultSetting );
getLogger().debug( "Applying [" + key + "] policy with [" + setting + "]" );
try
{
// all policies must approve the exception, any can cancel
process = policy.applyPolicy( setting, request, localFile, exception, previousExceptions );
if ( !process )
{
break;
}
}