Created
September 2, 2016 19:39
-
-
Save DreamingInBinary/be956063fe81118e1842842cad848db9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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