Skip to content

Commit

Permalink
CLI-1327: Handle corrupt db
Browse files Browse the repository at this point in the history
  • Loading branch information
danepowell committed Jul 23, 2024
1 parent df5af90 commit 3945d64
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
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

0 comments on commit 3945d64

Please sign in to comment.