We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ContentView.swift:
func login(username: String, password: String) { if let result = loginRepository.login(username: username, password: password) as? ResultSuccess { print("Successful login. Welcome, (result.data.displayName)") } else { print("Error while logging in") } }
login DataSource:
class LoginDataSource { fun login(username: String, password: String): Result<LoggedInUser> { try { // TODO: handle loggedInUser authentication val fakeUser = LoggedInUser(randomUUID(), "Jane Doe") return Result.Success(fakeUser) } catch (e: Throwable) { return Result.Error(RuntimeException("Error logging in", e)) } } fun logout() { // TODO: revoke authentication }}
how to get RuntimeException message if Result not success from ContentView.swift?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
ContentView.swift:
login DataSource:
class LoginDataSource {
fun login(username: String, password: String): Result<LoggedInUser> { try { // TODO: handle loggedInUser authentication val fakeUser = LoggedInUser(randomUUID(), "Jane Doe") return Result.Success(fakeUser) } catch (e: Throwable) { return Result.Error(RuntimeException("Error logging in", e)) } }
fun logout() { // TODO: revoke authentication }}
how to get RuntimeException message if Result not success from ContentView.swift?
The text was updated successfully, but these errors were encountered: