TM-SGNL-iOS/SignalServiceKit/Network/API/DeviceLimitExceededError.swift
TeleMessage developers dde0620daf initial commit
2025-05-03 12:28:28 -07:00

28 lines
825 B
Swift

//
// Copyright 2023 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
//
import Foundation
public struct DeviceLimitExceededError: LocalizedError {
public init() {}
init?(_ error: Error) {
guard error.httpStatusCode == 411 else { return nil }
}
public var errorDescription: String? {
OWSLocalizedString(
"MULTIDEVICE_PAIRING_MAX_DESC",
comment: "An error shown as the title of an alert when try to link a new device & the user is already at the limit."
)
}
public var recoverySuggestion: String? {
OWSLocalizedString(
"MULTIDEVICE_PAIRING_MAX_RECOVERY",
comment: "A recovery suggestion shown as the body of an alert when try to link a new device & the user is already at the limit."
)
}
}