Skip to content

Commit

Permalink
Make ConfigurationError marginally more useful by not squashing it in…
Browse files Browse the repository at this point in the history
… Configuration.rulesFromDict.
  • Loading branch information
scottrhoyt committed Jan 23, 2016
1 parent c5b32d9 commit c921a34
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Source/SwiftLintFramework/Models/Configuration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,10 @@ public struct Configuration: Equatable {
let identifier = rule.description.identifier
if let ConfigurableRuleType = rule as? ConfigurableRule.Type,
ruleConfig = dict?[identifier] {
if let configuredRule = try? ConfigurableRuleType.init(config: ruleConfig) {
do {
let configuredRule = try ConfigurableRuleType.init(config: ruleConfig)
rules.append(configuredRule)
} else {
} catch {
queuedPrintError("Invalid config for '\(identifier)'. Falling back to default.")
rules.append(rule.init())
}
Expand Down

0 comments on commit c921a34

Please sign in to comment.