File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -969,6 +969,7 @@ protected function generate_docker_compose( array $args = [] ) : void {
969
969
/**
970
970
* Return the Database connection details.
971
971
*
972
+ * @throws \RuntimeException When the database container cannot be found.
972
973
* @return array
973
974
*/
974
975
private function get_db_connection_data () {
@@ -1013,6 +1014,10 @@ private function get_db_connection_data() {
1013
1014
$ ports = shell_exec ( sprintf ( "$ command_prefix docker ps --format '{{.Ports}}' --filter id=%s " , $ db_container_id ) );
1014
1015
preg_match ( '/([\d.]+):([\d]+)->.*/ ' , trim ( $ ports ), $ ports_matches );
1015
1016
1017
+ if ( empty ( $ ports_matches ) ) {
1018
+ throw new \RuntimeException ( 'Could not retrieve information for the database. Is the container running? ' );
1019
+ }
1020
+
1016
1021
return array_merge (
1017
1022
array_filter ( $ values ),
1018
1023
[
You can’t perform that action at this time.
0 commit comments