Use native PHP Exception Code to transmit HTTP response code

As per PHP manual, Exceptions supports specifying error codes through
2nd argument of constructor:
http://www.php.net/manual/en/exception.getcode.php

This patch makes use of standard PHP functionality to transmit error
codes. This adds support for un-handled response types such as 402, 420
and others.