From 26901f82220fe18c0ad6e2bfc23c59b451a4e198 Mon Sep 17 00:00:00 2001 From: Frankie B Date: Fri, 8 Sep 2023 23:19:40 +0100 Subject: feat: add error handling (#14) * Remove commented out crap * Update theme to use some colors from catppuccin, add error handling for API/DB --- resources/views/pages/bookmarks.blade.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'resources/views/pages/bookmarks.blade.php') diff --git a/resources/views/pages/bookmarks.blade.php b/resources/views/pages/bookmarks.blade.php index 54d464d..d7d8283 100644 --- a/resources/views/pages/bookmarks.blade.php +++ b/resources/views/pages/bookmarks.blade.php @@ -3,7 +3,18 @@ @section('description', 'This is the personal homepage of floppydisk.') @section('content') @php - $categories = DB::select(' + $db_alive = true; + try { + DB::connection()->getPdo(); + } catch (Exception $e) { + $db_alive = false; + } + @endphp + @if (!$db_alive) + @include('components.errors.db-error') + @else + @php + $categories = DB::select(' SELECT id, name FROM bookmark__categories ORDER BY priority ASC @@ -37,4 +48,5 @@
@endforeach + @endif @stop -- cgit v1.2.3-54-g00ecf