httpexception.php 697 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * Part of the Fuel framework.
  4. *
  5. * @package Fuel
  6. * @version 1.5
  7. * @author Fuel Development Team
  8. * @license MIT License
  9. * @copyright 2010 - 2013 Fuel Development Team
  10. * @link http://fuelphp.com
  11. */
  12. namespace Fuel\Core;
  13. abstract class HttpException extends \FuelException
  14. {
  15. /**
  16. * Must return a response object for the handle method
  17. *
  18. * @return Response
  19. */
  20. abstract protected function response();
  21. /**
  22. * When this type of exception isn't caught this method is called by
  23. * Error::exception_handler() to deal with the problem.
  24. */
  25. public function handle()
  26. {
  27. $response = $this->response();
  28. \Event::shutdown();
  29. $response->send(true);
  30. }
  31. }