CrowdHailer / raxx

Interface for HTTP webservers, frameworks and clients
https://hexdocs.pm/raxx
Apache License 2.0
402 stars 29 forks source link

Raise error for incomplete response without new server state #54

Closed CrowdHailer closed 6 years ago

CrowdHailer commented 6 years ago

If any callback returns a response with body set to true an error should be raised. This is because the response is incomplete.

e.g.

defmodule MyServer do
use Raxx.Server

def handle_request(request, state) do
  response = Raxx.response(:ok)
  |> Raxx.set_body(true)
end
end

This example should raise an error the correct return value is {response, new_state}