Re:Hands-on Scala Programming
by erik_seaberg on Sunday April 19, 2020 @05:52PM
(#22919095)
Option does throw away the error. I like Try { expr } a lot, to the point that I retry, give up, and then serialize a Try[T <: Product] into a Row so flaky dependencies don't trash all the output from a big Spark job.
[ Parent
| on HN ]
Yes, that's true, if you want to propagate information about the nature of what went wrong locally (e.g. logging) you need to use something richer (e.g. Either).
Re:Hands-on Scala Programming
by erik_seaberg on Monday April 20, 2020 @08:38PM
(#22930581)
Yeah, Try[T] is basically Either[Throwable, T] with some glue for catching and rethrowing.