Skip to content

Commit 8303991

Browse files
committedApr 25, 2024··
Move internalCode check login into main switch
1 parent a58f93f commit 8303991

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed
 

‎TangemSdk/TangemSdk/Common/Core/TangemSdkError.swift

+6-10
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,12 @@ public enum TangemSdkError: Error, LocalizedError, Encodable {
516516
case .backupFailedAlreadyCreated:
517517
return "error_backup_failed_already_created".localized
518518
case .resetPinWrongCard(let internalCode):
519-
return localizedMessageForResetPinWrongCard(code: internalCode)
519+
switch internalCode {
520+
case TangemSdkError.noActiveBackup.code:
521+
return "error_no_active_backup".localized
522+
default:
523+
return "error_reset_wrong_card".localized("\(self.code)")
524+
}
520525
case .oldCard: return "error_old_card".localized
521526
case .userCodeRecoveryDisabled: return "error_user_code_recovery_disabled".localized
522527

@@ -530,15 +535,6 @@ public enum TangemSdkError: Error, LocalizedError, Encodable {
530535
}
531536
}
532537

533-
private func localizedMessageForResetPinWrongCard(code: Int?) -> String {
534-
switch code {
535-
case TangemSdkError.noActiveBackup.code:
536-
return "error_no_active_backup".localized
537-
default:
538-
return "error_reset_wrong_card".localized("\(self.code)")
539-
}
540-
}
541-
542538
public var jsonDescription: String {
543539
let encoder = JSONEncoder()
544540
encoder.outputFormatting = [.sortedKeys, .prettyPrinted]

0 commit comments

Comments
 (0)
Please sign in to comment.