-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInfraLayerError.swift
More file actions
49 lines (42 loc) · 1.11 KB
/
Copy pathInfraLayerError.swift
File metadata and controls
49 lines (42 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//
// InfraLayerError.swift
// DevLogInfra
//
// Created by opfic on 3/11/26.
//
import AuthenticationServices
import Foundation
import DevLogData
enum FirestoreError: Error, LocalizedError {
case dataNotFound(_ key: String)
var errorDescription: String? {
switch self {
case .dataNotFound(let key):
return "\(key)가 Firestore에서 존재하지 않음"
}
}
}
enum UIError: Error {
case notFoundTopViewController
}
enum TokenError: Error {
case invalidResponse
}
enum SocialLoginError: Error {
case invalidOAuthState
case failedToStartWebAuthenticationSession
case authenticationAlreadyInProgress
}
extension Error {
var isSocialLoginCancelled: Bool {
switch self {
case let authError as ASAuthorizationError:
return authError.code == .canceled
case let webAuthError as ASWebAuthenticationSessionError:
return webAuthError.code == .canceledLogin
default:
let nsError = self as NSError
return nsError.domain == "com.google.GIDSignIn" && nsError.code == -5
}
}
}