TaskFailedEvent.php 652 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. * @deprecated 30.0.0
  12. */
  13. class TaskFailedEvent extends AbstractTextToImageEvent {
  14. /**
  15. * @param Task $task
  16. * @param string $errorMessage
  17. * @since 28.0.0
  18. */
  19. public function __construct(
  20. Task $task,
  21. private string $errorMessage,
  22. ) {
  23. parent::__construct($task);
  24. }
  25. /**
  26. * @return string
  27. * @since 28.0.0
  28. */
  29. public function getErrorMessage(): string {
  30. return $this->errorMessage;
  31. }
  32. }