Made credentials verification errors more descriptive.
This commit is contained in:
parent
bb42e46887
commit
38202ece8d
|
@ -28,8 +28,17 @@ final class FeedbinAPICaller: NSObject {
|
|||
switch result {
|
||||
case .success:
|
||||
handler(.success(true))
|
||||
case .failure:
|
||||
handler(.success(false))
|
||||
case .failure(let error):
|
||||
switch error {
|
||||
case TransportError.httpError(let status):
|
||||
if status == 401 {
|
||||
handler(.success(false))
|
||||
} else {
|
||||
handler(.failure(error))
|
||||
}
|
||||
default:
|
||||
handler(.failure(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -69,12 +69,12 @@ class AccountsAddFeedbinWindowController: NSWindowController, NSTextFieldDelegat
|
|||
|
||||
self.hostWindow?.endSheet(self.window!, returnCode: NSApplication.ModalResponse.OK)
|
||||
} else {
|
||||
self.errorMessageLabel.stringValue = NSLocalizedString("Unable to verify credentials.", comment: "Credentials Error")
|
||||
self.errorMessageLabel.stringValue = NSLocalizedString("Invalid email/password combination.", comment: "Credentials Error")
|
||||
}
|
||||
|
||||
case .failure:
|
||||
|
||||
self.errorMessageLabel.stringValue = NSLocalizedString("Unable to verify credentials due to networking error.", comment: "Credentials Error")
|
||||
self.errorMessageLabel.stringValue = NSLocalizedString("Network error. Try again later.", comment: "Credentials Error")
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue