Skip to content

Commit

Permalink
Fix typo in Result#unwrap exception message
Browse files Browse the repository at this point in the history
Fixes #8
  • Loading branch information
michaelbull committed Jan 11, 2020
1 parent 6651b18 commit 434b8aa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/kotlin/com/github/michaelbull/result/Unwrap.kt
Expand Up @@ -19,7 +19,7 @@ fun <V, E> Result<V, E>.unwrap(): V {

return when (this) {
is Ok -> value
is Err -> throw UnwrapException("called Result.wrap on an Err value $error")
is Err -> throw UnwrapException("called Result.unwrap on an Err value $error")
}
}

Expand Down
Expand Up @@ -16,7 +16,7 @@ class UnwrapTest {

@Test
fun throwsExceptionIfErr() {
assertFailsWith<UnwrapException>("called Result.wrap on an Err value 5000") {
assertFailsWith<UnwrapException>("called Result.unwrap on an Err value 5000") {
@Suppress("IMPLICIT_NOTHING_AS_TYPE_PARAMETER")
Err(5000).unwrap()
}
Expand Down

0 comments on commit 434b8aa

Please sign in to comment.