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

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

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

import akka.http.scaladsl.server.{Directives, Route}
import org.elasticmq.rest.sqs.{AnyParams, SQSException}
import org.elasticmq.util.Logging

trait UnmatchedActionRoutes {
  this: Logging with Directives =>

  def unmatchedAction(p: AnyParams): Route = {
    extractRequestContext { _ =>
      p.get("Action") match {
        case Some(action) =>
          logger.warn(s"Unknown action: $action")
          throw new SQSException("InvalidAction")
        case None => throw new SQSException("MissingAction")
      }
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy