Skip to content

Instantly share code, notes, and snippets.

@wbbernardes
Last active August 15, 2019 13:08
Show Gist options
  • Save wbbernardes/1760a8fe63a4d02dacde7ec05b62cf17 to your computer and use it in GitHub Desktop.
Save wbbernardes/1760a8fe63a4d02dacde7ec05b62cf17 to your computer and use it in GitHub Desktop.
//
// Error+enum.swift
//
// Created by Wesley Brito on 12/07/19.
// Copyright © 2019 Wesley Brito. All rights reserved.
//
import Foundation
enum RequestErrors: String {
case noInternet
case unexpectedError
case facebookLoginFailed
case googleLoginFailed
case invalidCredentials
case authError
var message: String {
switch self {
case .noInternet:
return "Check your Internet connection\nPull to refresh"
case .unexpectedError:
return "Erro ao recuperar os recuperar dados, tente novamente."
case .facebookLoginFailed:
return "Erro para efetuar login com o Facebook !"
case .googleLoginFailed:
return "Erro para efetuar login com o Google !"
case .invalidCredentials:
return "Dados inválidos, refaça a operação !"
case .authError:
return "Erro na autenticação, por favor refaça a operação"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment