EventProcessorException.php 994 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * Refer to LICENSE.txt distributed with the Temando Shipping module for notice of license
  4. */
  5. namespace Temando\Shipping\Sync\Exception;
  6. use Magento\Framework\Exception\LocalizedException;
  7. /**
  8. * Temando Event Processing Exception.
  9. *
  10. * The event should get handled but an error occurred.
  11. *
  12. * @package Temando\Shipping\Sync
  13. * @author Christoph Aßmann <christoph.assmann@netresearch.de>
  14. * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
  15. * @link http://www.temando.com/
  16. */
  17. class EventProcessorException extends LocalizedException
  18. {
  19. /**
  20. * @param string $entityType
  21. * @param string $entityId
  22. * @param \Exception|null $previous
  23. * @return static
  24. */
  25. public static function processingFailed($entityType, $entityId, \Exception $previous = null)
  26. {
  27. $phrase = __("Entity '%1' of type '%2' could not be processed.", $entityId, $entityType);
  28. return new static($phrase, $previous);
  29. }
  30. }