diff --git a/src/EventListener/ExceptionListener.php b/src/EventListener/ExceptionListener.php index 1f6bdf01b..89c1dbb6f 100644 --- a/src/EventListener/ExceptionListener.php +++ b/src/EventListener/ExceptionListener.php @@ -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; } } diff --git a/tests/phpunit/src/Misc/ExceptionListenerTest.php b/tests/phpunit/src/Misc/ExceptionListenerTest.php index a46e9657d..fd6c26096 100644 --- a/tests/phpunit/src/Misc/ExceptionListenerTest.php +++ b/tests/phpunit/src/Misc/ExceptionListenerTest.php @@ -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' => '',