Summary
The Kotlin wrapper has ApiDiscoveryResult.userFacingErrorMessage(url:) that maps API discovery failures to human-readable strings (offline, invalid SSL, not a WordPress site, etc.). The Swift side currently surfaces raw error.localizedDescription in the example app's LoginView, which produces unhelpful messages.
Context
Added in PR #1190 for Kotlin:
native/kotlin/api/kotlin/src/main/kotlin/rs/wordpress/api/kotlin/ApiDiscoveryResult.kt
We should align this approaches so they're similar. Kotlin's intermediate layer is much smaller, but we probably want to derive the user-facing error in Rust and share the approach.
Files to change
native/swift/Sources/wordpress-api/ — add error extension with user-facing messages
native/swift/Example/Example/UI/LoginView.swift — use the new messages in handleLoginError()
🤖 Generated with Claude Code
Summary
The Kotlin wrapper has
ApiDiscoveryResult.userFacingErrorMessage(url:)that maps API discovery failures to human-readable strings (offline, invalid SSL, not a WordPress site, etc.). The Swift side currently surfaces rawerror.localizedDescriptionin the example app'sLoginView, which produces unhelpful messages.Context
Added in PR #1190 for Kotlin:
native/kotlin/api/kotlin/src/main/kotlin/rs/wordpress/api/kotlin/ApiDiscoveryResult.ktWe should align this approaches so they're similar. Kotlin's intermediate layer is much smaller, but we probably want to derive the user-facing error in Rust and share the approach.
Files to change
native/swift/Sources/wordpress-api/— add error extension with user-facing messagesnative/swift/Example/Example/UI/LoginView.swift— use the new messages inhandleLoginError()🤖 Generated with Claude Code