runtime errors, such as those produced by die, should be serialized

send_error currently specifies the serializer to use, however, other
errors still produce an html page. The serializer can be obtained from
the context/app so all errors are rendered correctly.