add HTTPSpecialCaseException for database connection

This commit is contained in:
Thomas Rubini 2023-01-24 10:07:06 +01:00
parent 1f27156004
commit ac0ee6441d
No known key found for this signature in database
GPG Key ID: C7D287C8C1CAC373

View File

@ -17,7 +17,7 @@ final class Model
try{ try{
self::$conn = new PDO($PDO_URI, $_ENV["DB_USERNAME"], $_ENV["DB_PASSWORD"]); self::$conn = new PDO($PDO_URI, $_ENV["DB_USERNAME"], $_ENV["DB_PASSWORD"]);
}catch(PDOException $e){ }catch(PDOException $e){
die("Connection to the database failed"); throw new HTTPSpecialCaseException(500, "Connection to the database failed");
} }
} }
} }