Skip to content

Commit a437c9e

Browse files
authored
Merge pull request #59 from qschmick/fix/database-error-during-package-discovery
Fix/database error during package discovery
2 parents 7c6eafa + f27bf15 commit a437c9e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/Providers/TotemServiceProvider.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Studio\Totem\Providers;
44

55
use Cron\CronExpression;
6+
use Illuminate\Support\Facades\Log;
67
use Illuminate\Support\Facades\Schema;
78
use Illuminate\Support\ServiceProvider;
89
use Illuminate\Support\Facades\Validator;
@@ -49,8 +50,13 @@ public function register()
4950
$this->app->register(TotemRouteServiceProvider::class);
5051
$this->app->register(TotemEventServiceProvider::class);
5152

52-
if (Schema::hasTable('tasks')) {
53-
$this->app->register(ConsoleServiceProvider::class);
53+
try {
54+
if (Schema::hasTable('tasks')) {
55+
$this->app->register(ConsoleServiceProvider::class);
56+
}
57+
} catch (\PDOException $ex) {
58+
// This will trigger if DB cannot be connected to
59+
Log::error($ex->getMessage());
5460
}
5561

5662
$this->mergeConfigFrom(

0 commit comments

Comments
 (0)