dimsuz
09/15/2017, 3:24 PMif (hasFlightsOrMinPrices(searchParams, response)) response
else throw ServerError.FlightsNotFound(key = "FlightsNotFound", userMessage = "message", debugMessage = "no flights in response")
As you can see this is a ternary-like if operator, but it has really long expressions in its branches.
I currently format it like above, but other options would be:
if (hasFlightsOrMinPrices(searchParams, response)) response else
throw ServerError.FlightsNotFound(key = "FlightsNotFound", userMessage = "message", debugMessage = "no flights in response")
or
if (hasFlightsOrMinPrices(searchParams, response))
response
else
throw ServerError.FlightsNotFound(key = "FlightsNotFound", userMessage = "message", debugMessage = "no flights in response")