I’m looking for an equivalent to throw new HttpNotFoundException, but instead of throwing a 404 error, it throws a 500 (or other HTTP status of my choice), similar to CodeIgniter’s show_error('message' [, int $status_code= 500 ] ).
At the moment I’m having to make quite a complicated function to tidy up, work out if I’m using the template or not, and then show an error.
I’m looking for an equivalent to
throw new HttpNotFoundException
, but instead of throwing a 404 error, it throws a 500 (or other HTTP status of my choice), similar to CodeIgniter’sshow_error('message' [, int $status_code= 500 ] )
.At the moment I’m having to make quite a complicated function to tidy up, work out if I’m using the template or not, and then show an error.
Would anybody else use something like this?