aboutsummaryrefslogtreecommitdiff
path: root/resources/views/pages/bookmarks.blade.php
diff options
context:
space:
mode:
authorFrankie B <git@diskfloppy.me>2023-09-08 23:19:40 +0100
committerGitHub <noreply@github.com>2023-09-08 23:19:40 +0100
commit26901f82220fe18c0ad6e2bfc23c59b451a4e198 (patch)
treeb199f4d6680b8b62869e5062768e519db846511d /resources/views/pages/bookmarks.blade.php
parent5d148485408bb169cba60c9a82d188442630d233 (diff)
feat: add error handling (#14)
* Remove commented out crap * Update theme to use some colors from catppuccin, add error handling for API/DB
Diffstat (limited to 'resources/views/pages/bookmarks.blade.php')
-rw-r--r--resources/views/pages/bookmarks.blade.php14
1 files changed, 13 insertions, 1 deletions
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 @@
</table>
<br>
@endforeach
+ @endif
@stop