Sample implementations of different error handling approaches:
ThrowParser
: exception throwingTryParser
: exception packing intoTry[T]
EitherParser
: error handling asEither[String, T]
ValidatedParser
: usingcats
Validated
for collecting as much errors as possible (non-fail-fast)
Problem here is data conversion and validation.
Each implementation is a PersonParser
that
converts Map[String, String]
into
Person(String, Int, Boolean)
or error.