Skip to content

Commit

Permalink
Correct exception type in readme (#253)
Browse files Browse the repository at this point in the history
  • Loading branch information
gmal1 authored and lloydmeta committed Sep 26, 2019
1 parent 77d9bf8 commit 0e19f28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Greeting.withName("Hello")
// => res0: Greeting = Hello

Greeting.withName("Haro")
// => java.lang.IllegalArgumentException: Haro is not a member of Enum (Hello, GoodBye, Hi, Bye)
// => java.lang.NoSuchElementException: Haro is not a member of Enum (Hello, GoodBye, Hi, Bye)

// A safer alternative would be to use `withNameOption(name: String)` method which returns an Option[Greeting]
Greeting.withNameOption("Hello")
Expand Down

0 comments on commit 0e19f28

Please sign in to comment.