Skip to content

Commit 5884dc0

Browse files
committed
Update AsyncLocationErrors.swift
1 parent 04ec135 commit 5884dc0

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

Sources/d3-async-location/enum/AsyncLocationErrors.swift

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,26 @@ public enum AsyncLocationErrors: Error{
2828
case coreLocationManagerError(CLError)
2929

3030
}
31+
32+
33+
@available(iOS 14.0, watchOS 7.0, *)
34+
extension AsyncLocationErrors: LocalizedError {
35+
public var errorDescription: String? {
36+
switch self {
37+
case .accessIsNotAuthorized:
38+
return NSLocalizedString("Access was denied by the user.", comment: "")
39+
40+
case .streamingProcessHasAlreadyStarted:
41+
return NSLocalizedString("Attempted to start streaming while it's already running.", comment: "")
42+
43+
case .streamCanceled:
44+
return NSLocalizedString("The stream was cancelled or terminated.", comment: "")
45+
46+
case .streamUnknownTermination:
47+
return NSLocalizedString("The stream was cancelled or terminated due to an unknown error.", comment: "")
48+
49+
case .coreLocationManagerError(let error):
50+
return error.localizedDescription
51+
}
52+
}
53+
}

0 commit comments

Comments
 (0)