-
-
Save Jacoby6000/6c8830f8879c24a4e3a7ffd3b72acbb5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def apply(input: String): String = { | |
val output = | |
Utils.read[SealedTraitParent](input) match { | |
case Some(predict: Predict) => | |
println(predict) | |
predict.process(client) | |
case Some(train: Training) => | |
println(train) | |
train.process(client) | |
case None => | |
println(input) | |
Right(new AlgorithmException(s"failed to parse")) | |
} | |
output match { | |
case Left(result) => Utils.Write(result).nospaces | |
case Right(err) => throw err | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment