2 ms·
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 depe
by erik_seaberg 7y ago
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.
- 9q9 7y agoYes, 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).
- erik_seaberg 7y agoYeah, Try[T] is basically Either[Throwable, T] with some glue for catching and rethrowing.