Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to debug errors of bin/magento #1182

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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