Skip to content

Commit

Permalink
Merge pull request #152 from woocommerce/24-03/add-empty-extension-li…
Browse files Browse the repository at this point in the history
…st-exception

Add empty extension list exception
  • Loading branch information
zhongruige authored Mar 22, 2024
2 parents 614d695 + 71e022e commit d48c13f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/src/Commands/Backend/AddBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ protected function execute( InputInterface $input, OutputInterface $output ): in
try {
$this->woo_extensions_list->fetch_woo_extensions_available();
if ( empty( $this->woo_extensions_list->get_woo_extension_list() ) ) {
throw new \RuntimeException();
throw new \RuntimeException( 'Failed to get the list of Extensions. Do you have any?' );
}
} catch ( \Exception $e ) {
$this->auth->delete_manager_secret();
$this->cache->delete( 'manager_url' );
$output->writeln( sprintf( '<error>We could not authenticate to %s using the provided Manager Secret.</error>', escapeshellarg( $manager_url ) ) );
$output->writeln( sprintf( '<error>We could not authenticate to %s using the provided Manager Secret. Error: %s</error>', escapeshellarg( $manager_url ), $e->getMessage() ) );

return Command::FAILURE;
}
Expand Down

0 comments on commit d48c13f

Please sign in to comment.