exceptions.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /**
  3. * This file is part of the Nette Framework (https://nette.org)
  4. * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
  5. */
  6. declare(strict_types=1);
  7. namespace Nette\Utils;
  8. /**
  9. * The exception that is thrown when an image error occurs.
  10. */
  11. class ImageException extends \Exception
  12. {
  13. }
  14. /**
  15. * The exception that indicates invalid image file.
  16. */
  17. class UnknownImageFileException extends ImageException
  18. {
  19. }
  20. /**
  21. * The exception that indicates error of JSON encoding/decoding.
  22. */
  23. class JsonException extends \Exception
  24. {
  25. }
  26. /**
  27. * The exception that indicates error of the last Regexp execution.
  28. */
  29. class RegexpException extends \Exception
  30. {
  31. public const MESSAGES = [
  32. PREG_INTERNAL_ERROR => 'Internal error',
  33. PREG_BACKTRACK_LIMIT_ERROR => 'Backtrack limit was exhausted',
  34. PREG_RECURSION_LIMIT_ERROR => 'Recursion limit was exhausted',
  35. PREG_BAD_UTF8_ERROR => 'Malformed UTF-8 data',
  36. PREG_BAD_UTF8_OFFSET_ERROR => 'Offset didn\'t correspond to the begin of a valid UTF-8 code point',
  37. 6 => 'Failed due to limited JIT stack space', // PREG_JIT_STACKLIMIT_ERROR
  38. ];
  39. }
  40. /**
  41. * The exception that indicates assertion error.
  42. */
  43. class AssertionException extends \Exception
  44. {
  45. }