mirror of
https://github.com/XcodesOrg/XcodesApp.git
synced 2026-03-25 08:55:46 +00:00
Unwrap auth error messages to avoid "Optional(...)"
This commit is contained in:
parent
e21e4d9cdf
commit
6b5c288a40
1 changed files with 5 additions and 1 deletions
|
|
@ -337,7 +337,11 @@ final class HelperClient {
|
|||
private func executeAuthorizationFunction(_ authorizationFunction: () -> (OSStatus) ) throws {
|
||||
let osStatus = authorizationFunction()
|
||||
guard osStatus == errAuthorizationSuccess else {
|
||||
throw HelperClientError.message(String(describing: SecCopyErrorMessageString(osStatus, nil)))
|
||||
if let message = SecCopyErrorMessageString(osStatus, nil) {
|
||||
throw HelperClientError.message(String(message as NSString))
|
||||
} else {
|
||||
throw HelperClientError.message("Unknown error")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue