News for hackers. Stuff that matters.
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.
Re:Hands-on Scala Programming by 9q9 on Monday April 20, 2020 @07:21AM (#22922893)
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.