Skip to content

Commit

Permalink
Update AsyncLocationErrors.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
swiftuiux committed Nov 27, 2024
1 parent 04ec135 commit 5884dc0
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Sources/d3-async-location/enum/AsyncLocationErrors.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,26 @@ public enum AsyncLocationErrors: Error{
case coreLocationManagerError(CLError)

}


@available(iOS 14.0, watchOS 7.0, *)
extension AsyncLocationErrors: LocalizedError {
public var errorDescription: String? {
switch self {
case .accessIsNotAuthorized:
return NSLocalizedString("Access was denied by the user.", comment: "")

case .streamingProcessHasAlreadyStarted:
return NSLocalizedString("Attempted to start streaming while it's already running.", comment: "")

case .streamCanceled:
return NSLocalizedString("The stream was cancelled or terminated.", comment: "")

case .streamUnknownTermination:
return NSLocalizedString("The stream was cancelled or terminated due to an unknown error.", comment: "")

case .coreLocationManagerError(let error):
return error.localizedDescription
}
}
}

0 comments on commit 5884dc0

Please sign in to comment.