Exception.php 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * KO7 Error Exception Class
  4. */
  5. class KO7_Error_Exception extends ErrorException {
  6. /**
  7. * Creates a new translated exception.
  8. *
  9. * throw new KO7_Error_Exception('Something went terrible wrong, :user',
  10. * array(':user' => $user));
  11. *
  12. * @param string $message Error message
  13. * @param array $variables Translation variables
  14. * @param int $code The error code
  15. * @param int $severity The severity level of the exception.
  16. * @param string $file The filename where the exception is thrown.
  17. * @param int $line The line number where the exception is thrown.
  18. * @param Throwable $previous Previous throwable
  19. * @return void
  20. */
  21. public function __construct(string $message = '', array $variables = NULL, int $code = 0, int $severity = 1, string $file = __FILE__, int $line = __LINE__, $previous = NULL)
  22. {
  23. // Set the message
  24. $message = I18n::get([$message, $variables]);
  25. // Pass the message and integer code to the parent
  26. parent::__construct($message, $code, $severity, $file, $line, $previous);
  27. }
  28. }