[Web] Show error when connection to redis fails (instead of 5xx)

master
andryyy 2019-05-28 15:18:27 +02:00
parent 314b8c52a0
commit 8537767443
No known key found for this signature in database
GPG Key ID: 8EC34FF2794E25EF
1 changed files with 9 additions and 1 deletions

View File

@ -41,7 +41,15 @@ $tfa = new RobThree\Auth\TwoFactorAuth($OTP_LABEL, 6, 30, 'sha1', $qrprovider);
// Redis // Redis
$redis = new Redis(); $redis = new Redis();
try {
$redis->connect('redis-mailcow', 6379); $redis->connect('redis-mailcow', 6379);
}
catch (Exception $e) {
?>
<center style='font-family:sans-serif;'>Connection to Redis failed.<br /><br />The following error was reported:<br/><?=$e->getMessage();?></center>
<?php
exit;
}
// PDO // PDO
// Calculate offset // Calculate offset