All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ru.tinkoff.phobos.decoding.package.scala Maven / Gradle / Ivy

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