TaskFailedEvent.php 630 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\TextToImage\Events;
  8. use OCP\TextToImage\Task;
  9. /**
  10. * @since 28.0.0
  11. */
  12. class TaskFailedEvent extends AbstractTextToImageEvent {
  13. /**
  14. * @param Task $task
  15. * @param string $errorMessage
  16. * @since 28.0.0
  17. */
  18. public function __construct(
  19. Task $task,
  20. private string $errorMessage,
  21. ) {
  22. parent::__construct($task);
  23. }
  24. /**
  25. * @return string
  26. * @since 28.0.0
  27. */
  28. public function getErrorMessage(): string {
  29. return $this->errorMessage;
  30. }
  31. }