diff options
author | Damian Rzeszot <damian.rzeszot@gmail.com> | 2017-10-09 11:56:50 +0200 |
---|---|---|
committer | Damian Rzeszot <damian.rzeszot@gmail.com> | 2017-10-09 08:04:01 +0200 |
commit | 62d4b1483b850da0a99c2aa6c2da8b013e308f50 (patch) | |
tree | 08a05ef2e1e560d68902b2c59a6afe06b92c6904 /swift.html.markdown | |
parent | 39665aaad785115a023b8195c50819eca73b758a (diff) |
swift | fix style guidelines
Diffstat (limited to 'swift.html.markdown')
-rw-r--r-- | swift.html.markdown | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/swift.html.markdown b/swift.html.markdown index 60915d72..46388ca5 100644 --- a/swift.html.markdown +++ b/swift.html.markdown @@ -361,14 +361,14 @@ print("Name is \(name)") // Name is Them // The `Error` protocol is used when throwing errors to catch enum MyError: Error { - case BadValue(msg: String) - case ReallyBadValue(msg: String) + case badValue(msg: String) + case reallyBadValue(msg: String) } // functions marked with `throws` must be called using `try` func fakeFetch(value: Int) throws -> String { guard 7 == value else { - throw MyError.ReallyBadValue(msg: "Some really bad value") + throw MyError.reallyBadValue(msg: "Some really bad value") } return "test" @@ -385,7 +385,7 @@ func testTryStuff() { do { // normal try operation that provides error handling via `catch` block try fakeFetch(value: 1) - } catch MyError.BadValue(let msg) { + } catch MyError.badValue(let msg) { print("Error message: \(msg)") } catch { // must be exhaustive |