Skip to content

Commit

Permalink
Merge pull request #20 from keboola/adamvyborny-CM-576-handle-mongo-e…
Browse files Browse the repository at this point in the history
…rrors-even-in-fetching-last-value

Handle Mongo errors even on getting last fetched value
AdamVyborny authored Apr 20, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 0765cd2 + 7d303c6 commit 3b0d22a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Export.php
Original file line number Diff line number Diff line change
@@ -164,6 +164,7 @@ public static function buildIncrementalFetchingParams(

/**
* @throws \Keboola\Component\UserException
* @throws \Throwable
*/
public function getLastFetchedValue(): mixed
{
@@ -177,7 +178,11 @@ public function getLastFetchedValue(): mixed

$cliCommand = $this->exportCommandFactory->create($options);
$process = Process::fromShellCommandline($cliCommand, null, null, null, null);
$process->mustRun();
try {
$process->mustRun();
} catch (ProcessFailedException $e) {
$this->handleMongoExportFails($e);
}

$output = $process->getOutput();
if (!empty($output)) {

0 comments on commit 3b0d22a

Please sign in to comment.