Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Change log

## [Unreleased][unreleased]
### Added
- Add error logging to ProgressTask and BatchProgressTask

## 2.3.0 - 2024-05-14
### Added
- Configurable sleeping time
Expand Down
3 changes: 3 additions & 0 deletions src/Task/BatchProgressTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ protected function process(InputInterface $input, OutputInterface $output): Task
try {
$taskResult = $this->processItem($item);
} catch (Throwable $e) {
$this->logger->error($e->getMessage(), array_merge($this->getLogContext(), [
'exception' => $e
]));
$taskResult = new ErrorResult($e->getMessage(), [], $e);
}

Expand Down
3 changes: 3 additions & 0 deletions src/Task/ProgressTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ protected function process(InputInterface $input, OutputInterface $output): Task
try {
$taskResult = $this->processItem($item);
} catch (Throwable $e) {
$this->logger->error($e->getMessage(), array_merge($this->getLogContext(), [
'exception' => $e
]));
$taskResult = new ErrorResult($e->getMessage(), [], $e);
}

Expand Down