Skip to content

Commit

Permalink
Merge pull request #364 from nextcloud/enh/improve-command-exception-…
Browse files Browse the repository at this point in the history
…debug-output
  • Loading branch information
Pytal authored Feb 21, 2023
2 parents 48f30c9 + e5fc209 commit d19897b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions lib/Command/Export.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$io->writeln("Export saved in $folder/$exportName.zip");
} catch (\Exception $e) {
if ($io->isDebug()) {
$io->error($e->getTraceAsString());
$io->error("$e");
} else {
$io->error($e->getMessage());
}
$io->error($e->getMessage());
return $e->getCode() !== 0 ? (int)$e->getCode() : 1;
}

Expand Down
5 changes: 3 additions & 2 deletions lib/Command/Import.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$io->writeln("Successfully imported from ${path}");
} catch (\Exception $e) {
if ($io->isDebug()) {
$io->error($e->getTrace());
$io->error("$e");
} else {
$io->error($e->getMessage());
}
$io->error($e->getMessage());
return $e->getCode() !== 0 ? (int)$e->getCode() : 1;
}

Expand Down

0 comments on commit d19897b

Please sign in to comment.