Skip to content

Commit d3d3f97

Browse files
authored
Merge pull request #349 from norkunas/fix-err-msg
Fix throwing TaskException with valid type argument
2 parents b01fa55 + 98923ae commit d3d3f97

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Command/MeilisearchImportCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ private function formatIndexingResponse(array $batch, int $responseTimeout): arr
176176
$task = $indexInstance->getTask($apiResponse['taskUid']);
177177

178178
if ('failed' === $task['status']) {
179-
throw new TaskException($task['error']);
179+
throw new TaskException($task['error']['message']);
180180
}
181181

182182
$formattedResponse[$indexName] += $task['details']['indexedDocuments'];

src/Services/SettingsUpdater.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function update(string $indice, ?int $responseTimeout = null): void
7070
$task = $indexInstance->getTask($task['taskUid']);
7171

7272
if ('failed' === $task['status']) {
73-
throw new TaskException($task['error']);
73+
throw new TaskException($task['error']['message']);
7474
}
7575

7676
$this->eventDispatcher->dispatch(new SettingsUpdatedEvent($index['class'], $indexName, $variable));

0 commit comments

Comments
 (0)