On Fri, Jun 22, 2012 at 11:52 PM, Andrew Havens <
misbe...@gmail.com> wrote:
> I don't consider the server not starting as business logic. Also, this is a
> feature of http. If you say that you only accept json, the server should
> respond with json. A simple json version of the html page would suffice:
>
> {
> error_message: 'goes here',
> exception_class: 'goes here',
> application_root: 'goes here',
> backtrace: ...
> }
>
> I would be happy to contribute this feature if you could direct me to where
> the logic for rendering the template is taking place.
Ok, I don't mind accepting a patch for this.
Since 3.2 is nearing completion and has a completely different HTTP
I/O handler than 3.0, please work from the 'experimental' branch
instead of 'master'. The HTTP I/O handler can be found in
ext/common/agents/HelperAgent/RequestHandler.h.
sessionCheckedOut_real() is where it first notices that the
application has failed to spawn. When e != NULL, it will write an
error response to the client using writeErrorResponse(). You can
modify writeErrorResponse() to write JSON instead of HTML when
appropriate.
We require contributors to sign our contributor agreement before we
can merge their patches, so please sign this form:
http://www.phusion.nl/forms/contributor_agreement
Let me know if you have any questions.