
ru.tinkoff.phobos.decoding.package.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of phobos-core_2.13 Show documentation
Show all versions of phobos-core_2.13 Show documentation
Fast xml data binding library
The newest version!
package ru.tinkoff.phobos
import com.fasterxml.aalto.{AsyncByteArrayFeeder, AsyncXMLStreamReader}
import scala.util.{Failure, Success, Try}
package object decoding {
type XmlStreamReader = AsyncXMLStreamReader[AsyncByteArrayFeeder]
private[decoding] def wrapException[A](f: String => A) =
(history: List[String], string: String) =>
Try(f(string)) match {
case Failure(exception) =>
Left(DecodingError(Option(exception.getMessage).getOrElse("No text provided"), history, Some(exception)))
case Success(a) => Right(a)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy