feat: add error handling (#14)

* Remove commented out crap
* Update theme to use some colors from catppuccin, add error handling for API/DB
This commit is contained in:
Frankie B 2023-09-08 23:19:40 +01:00 committed by GitHub
commit 9a0d3a4ccc
8 changed files with 85 additions and 15 deletions

View file

@ -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