Skip to content

Instantly share code, notes, and snippets.

@benjaminsnorris
Created May 9, 2016 21:53
Show Gist options
  • Save benjaminsnorris/5389055d19e96295f03dcec01e1f3209 to your computer and use it in GitHub Desktop.
Save benjaminsnorris/5389055d19e96295f03dcec01e1f3209 to your computer and use it in GitHub Desktop.
Swift error with default description
// From Tim Shadel
enum FakeError: String, ErrorType, CustomStringConvertible {
case LoginFailed
var description: String {
return "FakeError: \(self.rawValue)"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment