title: Conditionally skip flow using akka streams
body: <p>I'm using akka streams and I have a segment of my graph that I need to conditionally skip because the flow can't handle certain values. Specifically, I have a flow that takes a string and makes http requests, but the server can't handle the case when the string is empty. But I need to just return an empty string instead. Is there a way of doing this without having to go through the http request knowing it will fail? I basically have this:</p>
  
  <pre><code>val source = Source("1", "2", "", "3", "4")
  val httpRequest: Flow[String, HttpRequest, _]
  val httpResponse: Flow[HttpResponse, String, _]
  val flow = source.via(httpRequest).via(httpResponse)
  </code></pre>
  
  <p>The only thing I can think of doing is catching the 400 error in my httpResponse flow and returning a default value. But I'd like to be able to avoid the overhead of hitting the server for a request I know is going to fail beforehand.</p>