TaskFailedEvent.php 621 B

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