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

org.elasticmq.rest.sqs.directives.RejectionDirectives.scala Maven / Gradle / Ivy

The newest version!
package org.elasticmq.rest.sqs.directives

import akka.http.scaladsl.server.{Rejection, RejectionHandler, Directives}
import org.elasticmq.rest.sqs.SQSException

trait RejectionDirectives {
  this: Directives with ExceptionDirectives =>

  val rejectionHandler = RejectionHandler.newBuilder().handleAll[Rejection] {
    case rejections =>
      handleServerExceptions { _ =>
        throw new SQSException("Invalid request: " + rejections.map(_.toString).mkString(", "))
      }
  }.result()

  def handleRejectionsWithSQSError = handleRejections(rejectionHandler)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy