Skip to content

Commit

Permalink
push return failure on error and add handle verbose
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskapp committed Feb 15, 2025
1 parent 0099f82 commit 8b2dd6f
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/Console/PushCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,21 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$accessToken = $this->obtainAccessToken($clientId, $clientSecret);
$userName = $this->obtainUserName($accessToken);

$this->importDocument($accessToken, $userName, $name, $result);
try {
$this->importDocument($accessToken, $userName, $name, $result);

$output->writeln('Document import Successful!');
$output->writeln('Document import Successful!');

return Command::SUCCESS;
return Command::SUCCESS;
} catch (\Throwable $e) {
$output->writeln($e->getMessage());
if ($output->isVerbose()) {
$output->writeln('Document:');
$output->writeln($result);
}

return Command::FAILURE;
}
}

private function importDocument(string $accessToken, string $user, string $document, string $spec): void
Expand Down

0 comments on commit 8b2dd6f

Please sign in to comment.