Skip to content

Commit

Permalink
Add a way to debug errors of bin/magento
Browse files Browse the repository at this point in the history
Also relates to netz98#1164
  • Loading branch information
cmuench committed Jul 31, 2023
1 parent 81ba11a commit 4cd0671
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ RECENT CHANGES

- Add: New commands to manage sales sequences (by Jeroen Boersma)
- Add: New command to redeploy base packages (by Christian Münch)
- Imp: Add debug output if Magento Core Commands cannot be used (by Christian Münch)

7.0.3
-----
Expand Down
7 changes: 7 additions & 0 deletions src/N98/Magento/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -533,9 +533,16 @@ public function registerMagentoCoreCommands(OutputInterface $output): void
);
$coreCommands = $provider->getCommands();
} catch (\Exception $e) {
if (OutputInterface::VERBOSITY_DEBUG <= $output->getVerbosity()) {
$output->writeln(
sprintf('<debug>Exception: %s</debug>', $e->getMessage())
);
}

$output->writeln(
[
'<error>Magento Core Commands cannot be loaded. Please verify if "bin/magento" is running.</error>',
'<info>Run with <comment>-vvv</comment> option to see the error output.</info>',
'<info>Only n98-magerun2 commands are available until the issue is fixed.</info>'
]
);
Expand Down

0 comments on commit 4cd0671

Please sign in to comment.