Add exception for SQLite databases that can't be found.

This commit is contained in:
Taylor Otwell 2011-06-21 13:14:54 -07:00
parent dbc418c0d7
commit fcdcc656b4
1 changed files with 4 additions and 0 deletions

View File

@ -41,6 +41,10 @@ public static function connect($config)
{ {
return new \PDO('sqlite:'.$config->database, null, null, static::$options); return new \PDO('sqlite:'.$config->database, null, null, static::$options);
} }
else
{
throw new \Exception("SQLite database [".$config->database."] could not be found.");
}
} }
// ----------------------------------------------------- // -----------------------------------------------------
// Connect to MySQL or Postgres. // Connect to MySQL or Postgres.