@@ -302,21 +302,23 @@ private List<string> ParseSettingValueStringOrStrings(object value, string setti
302
302
return strings ;
303
303
}
304
304
305
- private bool ParseSettingValueBoolean ( object value , string settingName )
305
+ private bool ? ParseSettingValueBoolean ( object value , string settingName , IList < Exception > exceptions )
306
306
{
307
307
if ( value == null )
308
308
{
309
- throw new InvalidDataException ( string . Format (
309
+ exceptions . Add ( new InvalidDataException ( string . Format (
310
310
Strings . SettingValueIsNull ,
311
- settingName ) ) ;
311
+ settingName ) ) ) ;
312
+ return null ;
312
313
}
313
314
314
315
if ( ! ( value is bool ) )
315
316
{
316
- throw new InvalidDataException ( string . Format (
317
+ exceptions . Add ( new InvalidDataException ( string . Format (
317
318
Strings . SettingValueIsNotBooleanType ,
318
319
settingName ,
319
- value ) ) ;
320
+ value ) ) ) ;
321
+ return null ;
320
322
}
321
323
322
324
return ( bool ) value ;
@@ -386,13 +388,23 @@ private void ParseSettingsHashtable(Hashtable settings)
386
388
break ;
387
389
388
390
case "includedefaultrules" :
389
- // TODO Aggregate exceptions.
390
- this . includeDefaultRules = ParseSettingValueBoolean ( setting . Value , settingName ) ;
391
+ bool ? maybeIncludeDefaultRules = ParseSettingValueBoolean ( setting . Value , settingName , exceptions ) ;
392
+ if ( maybeIncludeDefaultRules is null )
393
+ {
394
+ continue ;
395
+ }
396
+
397
+ this . includeDefaultRules = ( bool ) maybeIncludeDefaultRules ;
391
398
break ;
392
399
393
400
case "recursecustomrulepath" :
394
- // TODO Aggregate exceptions.
395
- this . recurseCustomRulePath = ParseSettingValueBoolean ( setting . Value , settingName ) ;
401
+ bool ? maybeRecurseCustomRulePath = ParseSettingValueBoolean ( setting . Value , settingName , exceptions ) ;
402
+ if ( maybeRecurseCustomRulePath is null )
403
+ {
404
+ continue ;
405
+ }
406
+
407
+ this . recurseCustomRulePath = ( bool ) maybeRecurseCustomRulePath ;
396
408
break ;
397
409
398
410
case "rules" :
0 commit comments