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:
parent
3fc99d1c9d
commit
9a0d3a4ccc
8 changed files with 85 additions and 15 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue