I have some function tat returns Try of some case class and I want to check if something came back in the Try I want to use its value and add it to a list, my code looks like this:
val resultLines = csvDataReader.iteratorWithHeaders.map(row => {
val someTry = fonctionThatReturnsTryOfSomeCaseClass(someArgument)
row ++ "key" -> someTry.map(a => a.someVal).getOrElse("")
}
my desired output is that to have resultLines be full with the rows, but the resultLines comes out as empty iterator...
it dosent really work, I get this error:
Error during generated code invocation: com.intellij.debugger.engine.evaluation.EvaluateException: Method threw 'java.lang.IllegalAccessError' exception.
Aucun commentaire:
Enregistrer un commentaire