Clean up ahead of PR.
This commit is contained in:
parent
e7ac736f7d
commit
cc83178d10
@ -164,11 +164,6 @@ public class MessageSenderErrorNoValidRecipients: NSObject, CustomNSError, IsRet
|
||||
MessageSenderErrorNoValidRecipients() as Error as NSError
|
||||
}
|
||||
|
||||
public var localizedDescription: String {
|
||||
NSLocalizedString("ERROR_DESCRIPTION_NO_VALID_RECIPIENTS",
|
||||
comment: "Error indicating that an outgoing message had no valid recipients.")
|
||||
}
|
||||
|
||||
/// NSError bridging: the domain of the error.
|
||||
/// :nodoc:
|
||||
@objc
|
||||
@ -189,6 +184,11 @@ public class MessageSenderErrorNoValidRecipients: NSObject, CustomNSError, IsRet
|
||||
[NSLocalizedDescriptionKey: self.localizedDescription]
|
||||
}
|
||||
|
||||
public var localizedDescription: String {
|
||||
NSLocalizedString("ERROR_DESCRIPTION_NO_VALID_RECIPIENTS",
|
||||
comment: "Error indicating that an outgoing message had no valid recipients.")
|
||||
}
|
||||
|
||||
public var isRetryableProvider: Bool { false }
|
||||
}
|
||||
|
||||
@ -215,12 +215,6 @@ public class MessageSenderNoSessionForTransientMessageError: NSObject, CustomNSE
|
||||
/// :nodoc:
|
||||
public var errorCode: Int { Self.errorCode }
|
||||
|
||||
/// NSError bridging: the error code within the given domain.
|
||||
/// :nodoc:
|
||||
public var errorUserInfo: [String: Any] {
|
||||
[NSLocalizedDescriptionKey: self.localizedDescription]
|
||||
}
|
||||
|
||||
public var isRetryableProvider: Bool { false }
|
||||
}
|
||||
|
||||
|
||||
@ -46,6 +46,7 @@ public class RESTSessionManager: NSObject {
|
||||
success: @escaping RESTNetworkManagerSuccess,
|
||||
failure: @escaping RESTNetworkManagerFailure) {
|
||||
assertOnQueue(NetworkManagerQueue())
|
||||
owsAssertDebug(!FeatureFlags.deprecateREST)
|
||||
|
||||
guard let rawRequestUrl = request.url else {
|
||||
owsFailDebug("Missing requestUrl.")
|
||||
|
||||
@ -385,9 +385,7 @@ public class OWSURLSession: NSObject {
|
||||
|
||||
@objc
|
||||
public static var signalIosUserAgent: String {
|
||||
let result = "Signal-iOS/\(AppVersion.shared().currentAppVersionLong) iOS/\(UIDevice.current.systemVersion)"
|
||||
Logger.verbose("---- userAgent: \(result)")
|
||||
return result
|
||||
"Signal-iOS/\(AppVersion.shared().currentAppVersionLong) iOS/\(UIDevice.current.systemVersion)"
|
||||
}
|
||||
|
||||
private func buildUrl(_ urlString: String) -> URL? {
|
||||
|
||||
@ -308,6 +308,13 @@ public extension Error {
|
||||
HTTPResponseDataForError(self)
|
||||
}
|
||||
|
||||
var httpRequestUrl: URL? {
|
||||
guard let error = self as? HTTPError else {
|
||||
return nil
|
||||
}
|
||||
return error.requestUrl
|
||||
}
|
||||
|
||||
var httpResponseJson: Any? {
|
||||
guard let data = httpResponseData else {
|
||||
return nil
|
||||
|
||||
@ -46,6 +46,13 @@ extension NSError {
|
||||
Logger.verbose("Network error without retry behavior specified: \(self)")
|
||||
return true
|
||||
}
|
||||
// Do not retry 4xx errors.
|
||||
if let statusCode = (self as Error).httpStatusCode,
|
||||
statusCode >= 400,
|
||||
statusCode <= 499 {
|
||||
Logger.info("Not retrying error: \(statusCode), \(String(describing: (self as Error).httpRequestUrl))")
|
||||
return false
|
||||
}
|
||||
|
||||
// This value should always be set for all errors by this
|
||||
// var is consulted. If not, default to retrying in production.
|
||||
|
||||
@ -202,7 +202,7 @@ public class FeatureFlags: BaseFlags {
|
||||
public static let deprecateREST = false
|
||||
|
||||
@objc
|
||||
public static let newHostNames = false
|
||||
public static let newHostNames = build.includes(.qa)
|
||||
|
||||
public static func buildFlagMap() -> [String: Any] {
|
||||
BaseFlags.buildFlagMap(for: FeatureFlags.self) { (key: String) -> Any? in
|
||||
|
||||
Loading…
Reference in New Issue
Block a user