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

endpoints4s.fetch.BuiltInErrors.scala Maven / Gradle / Ivy

The newest version!
package endpoints4s.fetch

import endpoints4s.{Invalid, algebra}

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

  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