title: How to know, if unmarshell was successful or not
body: <p>I have a route, that will unmarshell the incoming entity into a case class.</p>
  
  <pre><code>final case class ProducerMessage(topic: String, event: String, data: spray.json.JsObject)
  
  
  object ProducerServer {
  
    private val route: Route =   
      path("producer") {
          post {
            entity(as[ProducerMessage]) { msg =&gt;
              //complete(HttpEntity(ContentTypes.`text/html(UTF-8)`, "&lt;h1&gt;Say hello to akka-http&lt;/h1&gt;"))
            }
          }
        }
  
    def create(): Future[ServerBinding] {
      Http().bindAndHandle(route, getServerIp, getServerPort)
    }
  
  } 
  </code></pre>
  
  <p>How do I know, if the process of unmarshell was successfully or not?
  When received data is not a valid JSON format, what happen then? </p>