Skip to content
New issue

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

Functions like Try.flatMap or fold swallow RuntimeExceptions #39

Open
nhaarman opened this issue Dec 22, 2017 · 0 comments
Open

Functions like Try.flatMap or fold swallow RuntimeExceptions #39

nhaarman opened this issue Dec 22, 2017 · 0 comments
Assignees

Comments

@nhaarman
Copy link

Functions like Try<T>.flatMap and Try<T>.fold swallow RuntimeExceptions, making it harder to find bugs.

For example, I tried to use a TODO(), but my application did not terminate:

fun main(args: Array<String>) {
    val result = Success("Test").flatMap<Unit> { TODO() }
    println(result)
}

Instead, the console prints

Failure(kotlin.NotImplementedError: An operation is not implemented.)

@MarioAriasC MarioAriasC self-assigned this Dec 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants