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/guestbook.blade.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'resources/views/pages/guestbook.blade.php') diff --git a/resources/views/pages/guestbook.blade.php b/resources/views/pages/guestbook.blade.php index 08bc7cb..13415b4 100644 --- a/resources/views/pages/guestbook.blade.php +++ b/resources/views/pages/guestbook.blade.php @@ -1,13 +1,24 @@ @extends('layouts.default') @section('title', 'Guestbook') @section('content') + @php + $db_alive = true; + try { + DB::connection()->getPdo(); + } catch (Exception $e) { + $db_alive = false; + } + @endphp + @if (!$db_alive) + @include('components.errors.db-error') + @else
@csrf - + @@ -74,4 +85,5 @@
@@ -44,7 +55,7 @@

A few things to note:

  • You can submit an entry once every hour.
  • -
  • Your IP address is logged but not publically displayed.
  • +
  • Your IP address is logged but not publicly displayed.
  • Any entries that appear to be spam will be removed.

@endforeach + @endif @stop -- cgit v1.2.3-54-g00ecf