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

CLI-1327: Handle corrupt db #1772

Merged
merged 1 commit into from
Jul 23, 2024
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
4 changes: 4 additions & 0 deletions src/EventListener/ExceptionListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ public function onConsoleError(ConsoleErrorEvent $event): void
case 'Could not extract aliases to {destination}':
$this->helpMessages[] = 'Check that you have write access to the directory';
break;
case 'Unable to import local database. {message}':
$this->helpMessages[] = 'Check for MySQL warnings above or in the server log (/var/log/mysql/error.log)';
$this->helpMessages[] = 'Frequently, `MySQL server has gone away` messages are caused by max_allowed_packet being exceeded.';
break;
}
}

Expand Down
7 changes: 7 additions & 0 deletions tests/phpunit/src/Misc/ExceptionListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ public function providerTestHelp(): array
new AcquiaCliException('Could not extract aliases to {destination}'),
'Check that you have write access to the directory',
],
[
new AcquiaCliException('Unable to import local database. {message}'),
[
'Check for MySQL warnings above or in the server log (/var/log/mysql/error.log)',
'Frequently, `MySQL server has gone away` messages are caused by max_allowed_packet being exceeded.',
],
],
[
new ApiErrorException((object) [
'error' => '',
Expand Down
Loading