fuel / core

Fuel PHP Framework - The core of the Fuel v1 framework
http://fuelphp.com
805 stars 338 forks source link

Throwing a 500, or other non-404 error #699

Closed zoe-edwards closed 12 years ago

zoe-edwards commented 12 years ago

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.

Would anybody else use something like this?

zoe-edwards commented 12 years ago

Hang about, does it already exist? HttpServerErrorException? But it just isn’t in the Docs?

zoe-edwards commented 12 years ago

Yeah totally exists. See issue #260 in the Docs, not sure where to put it in the Docs.