CouldNotSaveException.php 1002 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\Exception\TemporaryState;
  7. use Magento\Framework\Exception\TemporaryStateExceptionInterface;
  8. use Magento\Framework\Exception\CouldNotSaveException as LocalizedCouldNotSaveException;
  9. use Magento\Framework\Phrase;
  10. /**
  11. * CouldNotSaveException caused by recoverable error
  12. *
  13. * @api
  14. * @since 101.0.0
  15. */
  16. class CouldNotSaveException extends LocalizedCouldNotSaveException implements TemporaryStateExceptionInterface
  17. {
  18. /**
  19. * Class constructor
  20. *
  21. * @param Phrase $phrase The Exception message to throw.
  22. * @param \Exception $previous [optional] The previous exception used for the exception chaining.
  23. * @param int $code [optional] The Exception code.
  24. */
  25. public function __construct(Phrase $phrase, \Exception $previous = null, $code = 0)
  26. {
  27. parent::__construct($phrase, $previous, $code);
  28. $this->code = $code;
  29. }
  30. }