Exception.php 947 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. *
  4. * Cube Framework $Id$ qLQIVYEPb5XLSNvNUpX0AF3fYgM0c1FJQsFBpYF0z3E=
  5. *
  6. * @link http://codecu.be/framework
  7. * @copyright Copyright (c) 2015 CodeCube SRL
  8. * @license http://codecu.be/framework/license Commercial License
  9. *
  10. * @version 1.4
  11. */
  12. /**
  13. * exceptions class
  14. */
  15. namespace Cube;
  16. /**
  17. * Class Exception
  18. *
  19. * @package Cube
  20. */
  21. class Exception extends \Exception
  22. {
  23. /**
  24. *
  25. * construct the exception
  26. *
  27. * @param string $message
  28. * @param int $code
  29. * @param \Exception $previous
  30. */
  31. public function __construct($message = null, $code = null, $previous = null)
  32. {
  33. parent::__construct($message, (int)$code, $previous);
  34. }
  35. /**
  36. *
  37. * display the exception
  38. *
  39. * @return string
  40. */
  41. public function display()
  42. {
  43. return '<div class="alert alert-danger">[Cube\Exception]<br> ' . $this->message . '</div>';
  44. }
  45. }