plack/Plack — pull request #440 by jjn1056 (2013-12-26 15:50:03+00:00)
Title: let an http-exception object that ->can("as_psgi") recieve the psgi $env...

... as its first argument

The idea here is that if the exception object is doing its own as_psgi, it might which to have access to $env so as to perform some content negotiation and provide the acceptable body content. Or for any other reasons. I don't think this change will cause any issues:

https://metacpan.org/pod/HTTP::Throwable#as_psgi

Says will accept $env but currently that is not used, so this change will work into the expectation I think.

HTTP::Exception does not have the as_psgi method so there's no compatibility problems.

I realized that the code that throws the exception object will also have $env and it is assumed that one could also do some content negotiation/etc there as well, but I think this change would make it easier for anyone working on a general framework to set some sane defaults.

code/test case/doc patch all included.