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

endpoints4s.sttp.client.BuiltInErrors.scala Maven / Gradle / Ivy

The newest version!
package endpoints4s.sttp.client

import endpoints4s.{Invalid, algebra}

/** @group interpreters
  */
trait BuiltInErrors[R[_]] extends algebra.BuiltInErrors {
  this: EndpointsWithCustomErrors[R] =>

  def clientErrorsResponseEntity: ResponseEntity[Invalid] =
    stringCodecResponse(endpoints4s.ujson.codecs.invalidCodec)

  def serverErrorResponseEntity: ResponseEntity[Throwable] =
    mapResponseEntity(clientErrorsResponseEntity)(invalid =>
      new Throwable(invalid.errors.mkString(". "))
    )

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy