Skip to content

Instantly share code, notes, and snippets.

@gmertk
Created October 25, 2015 10:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save gmertk/8c698c1c418350ca1dc7 to your computer and use it in GitHub Desktop.
Save gmertk/8c698c1c418350ca1dc7 to your computer and use it in GitHub Desktop.
enum APIError : ErrorType {
// Can't connect to the server (maybe offline?)
case ConnectionError(error: NSError)
// The server responded with a non 200 status code
case ServerError(statusCode: Int, error: NSError)
// We got no data (0 bytes) back from the server
case NoDataError
// The server response can't be converted from JSON to a Dictionary
case JSONSerializationError(error: ErrorType)
// The Argo decoding Failed
case JSONMappingError(converstionError: DecodeError)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment