mathieuleclaire on master
Update sbt-scalajs, scalajs-com… Merge pull request #141 from sc… (compare)
Hi, someone could tell me? please, why I get this error:
Cannot materialize pickler for non-case class: Either[String,T]. If this is a collection, the error can refer to the class inside.
[error] val unPickle = Unpickle[Either[String, T]].fromBytes(value)
with this code:
def searchDescripCatalog[T](id: String, component: Handler[String], resource: String) = {
val payload = Pickle.intoBytes[String](id)
val respondWS = client.send(resource :: Nil, payload, SendType.WhenConnected, 30 seconds)
respondWS.failed.foreach(println)
respondWS.onComplete {
case Success(value) =>
value match {
case Right(value) =>
val unPickle = Unpickle[Either[String, T]].fromBytes(value)
unPickle match {
case Right(value) => component.onNext(value.descripcion.getOrElse(""))
case Left(error) =>
org.scalajs.dom.window.prompt(error)
}
case Left(value) => org.scalajs.dom.window.prompt(value)
}
case Failure(exception) => org.scalajs.dom.window.prompt(exception.getMessage)
}
}
immutable.TreeMap
that contain types that don't already have a pickler?TreeMap
with LocalDate
as key and a case class as value. I assume it's the LocalDate
that's causing the issue, but even having a LocalDate pickler in scope doesn't seem to resolve the issue.