Integrasi Login dan menu Dasar SIAKAD Operator dan Mahasiswa

This commit is contained in:
Ariyutta
2026-11-02 09:08:03 +07:00
parent b7a0c8705b
commit 43269095bf
68 changed files with 4287 additions and 216 deletions
+26
View File
@@ -0,0 +1,26 @@
<?php
namespace App\Exceptions;
use Illuminate\Database\QueryException;
use PDOException;
use Throwable;
/** Pengenal galat koneksi DB (SQLSTATE kelas 08), mis. server DB lama tidak terjangkau dari luar jaringan UNTAN. */
final class DatabaseUnreachable
{
public const string MESSAGE = 'Tidak dapat menghubungkan ke server, silakan ganti menggunakan jaringan UNTAN.';
public static function matches(Throwable $e): bool
{
if (! $e instanceof QueryException && ! $e instanceof PDOException) {
return false;
}
// Saat membuka koneksi, kode PDO berisi kode driver (mis. 7); SQLSTATE hanya ada di awal pesan.
$pdo = $e instanceof QueryException ? ($e->getPrevious() ?? $e) : $e;
return str_starts_with((string) $e->getCode(), '08')
|| str_starts_with($pdo->getMessage(), 'SQLSTATE[08');
}
}