You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it's a small detail yet might be useful. I find it annoying that a failed Enumeration#withName call tells me nothing about the argument supplied. What about a small change:
finaldefwithName(s: String):Value= values.find(_.toString == s).getOrElse(
thrownewIllegalArgumentException(s"No value found for $s")
or to stay compatible
finaldefwithName(s: String):Value= values.find(_.toString == s).getOrElse(
thrownewNoSuchElementException(s"No value found for $s")
however I'm curious if anyone is seriously catching an NoSuchElementException :-)
it's a small detail yet might be useful. I find it annoying that a failed Enumeration#withName call tells me nothing about the argument supplied. What about a small change:
or to stay compatible
however I'm curious if anyone is seriously catching an NoSuchElementException :-)
I've posted this idea on the scala-internas as well:
https://groups.google.com/forum/#!topic/scala-internals/r6nq3s1SZds
The text was updated successfully, but these errors were encountered: