Convert some warnings to errors

This commit is contained in:
Davide De Rosa 2018-10-27 10:55:50 +02:00
parent 804585f13d
commit 4bcb1fe2ad
3 changed files with 7 additions and 7 deletions

View File

@ -125,7 +125,7 @@ class ConfigurationViewController: UIViewController, TableModelHost {
do { do {
(_, originalConfiguration) = try TunnelKitProvider.Configuration.parsed(from: url) (_, originalConfiguration) = try TunnelKitProvider.Configuration.parsed(from: url)
} catch let e { } catch let e {
log.warning("Could not parse original configuration: \(e)") log.error("Could not parse original configuration: \(e)")
return return
} }
initialConfiguration = originalConfiguration.sessionConfiguration initialConfiguration = originalConfiguration.sessionConfiguration

View File

@ -35,7 +35,7 @@ extension ConnectionService {
// log.verbose(String(data: newData, encoding: .utf8)!) // log.verbose(String(data: newData, encoding: .utf8)!)
try newData.write(to: to) try newData.write(to: to)
} catch let e { } catch let e {
log.warning("Could not migrate service: \(e)") log.error("Could not migrate service: \(e)")
} }
} }

View File

@ -221,7 +221,7 @@ class ConnectionService: Codable {
cache[key] = PlaceholderConnectionProfile(key) cache[key] = PlaceholderConnectionProfile(key)
} }
} catch let e { } catch let e {
log.warning("Could not list provider contents: \(e) (\(providersURL))") log.error("Could not list provider contents: \(e) (\(providersURL))")
} }
do { do {
let files = try fm.contentsOfDirectory(at: hostsURL, includingPropertiesForKeys: nil, options: []) let files = try fm.contentsOfDirectory(at: hostsURL, includingPropertiesForKeys: nil, options: [])
@ -234,7 +234,7 @@ class ConnectionService: Codable {
cache[key] = PlaceholderConnectionProfile(key) cache[key] = PlaceholderConnectionProfile(key)
} }
} catch let e { } catch let e {
log.warning("Could not list host contents: \(e) (\(hostsURL))") log.error("Could not list host contents: \(e) (\(hostsURL))")
} }
} }
@ -257,7 +257,7 @@ class ConnectionService: Codable {
try data.write(to: url) try data.write(to: url)
log.debug("Saved provider '\(profile.id)'") log.debug("Saved provider '\(profile.id)'")
} catch let e { } catch let e {
log.warning("Could not save provider '\(profile.id)': \(e)") log.error("Could not save provider '\(profile.id)': \(e)")
continue continue
} }
} else if let profile = entry as? HostConnectionProfile { } else if let profile = entry as? HostConnectionProfile {
@ -267,7 +267,7 @@ class ConnectionService: Codable {
try data.write(to: url) try data.write(to: url)
log.debug("Saved host '\(profile.id)'") log.debug("Saved host '\(profile.id)'")
} catch let e { } catch let e {
log.warning("Could not save host '\(profile.id)': \(e)") log.error("Could not save host '\(profile.id)': \(e)")
continue continue
} }
} else if let placeholder = entry as? PlaceholderConnectionProfile { } else if let placeholder = entry as? PlaceholderConnectionProfile {
@ -292,7 +292,7 @@ class ConnectionService: Codable {
} }
cache[key] = profile cache[key] = profile
} catch let e { } catch let e {
log.warning("Could not decode profile JSON: \(e)") log.error("Could not decode profile JSON: \(e)")
return nil return nil
} }
} }