Skip to content

Instantly share code, notes, and snippets.

@DreamingInBinary
Created September 2, 2016 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DreamingInBinary/be956063fe81118e1842842cad848db9 to your computer and use it in GitHub Desktop.
Save DreamingInBinary/be956063fe81118e1842842cad848db9 to your computer and use it in GitHub Desktop.
//
// NetworkError.swift
// Unofficial Metacritic
//
// Created by Jordan Morgan on 8/29/16.
// Copyright © 2016 Dreaming In Binary, LLC. All rights reserved.
//
import Foundation
enum ErrorOccurence:String
{
case GeneralError = "We ran into an unexpected issue, please try again later."
case BadResponse
case JSONSerialization
case InvalidURL
}
struct NetworkError
{
let message:String
let errorType:ErrorOccurence
}
extension NetworkError
{
init()
{
message = ErrorOccurence.GeneralError.rawValue
errorType = .GeneralError
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment