From 3441a0f2fbb19461039ce16a0387c8d02da08bf0 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Fri, 17 Apr 2026 17:41:46 +0000 Subject: refactor: Tighten dead branches and fail fast on missing index.html --- src/database.gleam | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'src/database.gleam') diff --git a/src/database.gleam b/src/database.gleam index 07264fd..5c3d9b2 100644 --- a/src/database.gleam +++ b/src/database.gleam @@ -64,18 +64,8 @@ pub fn get_counter(connection, name) { option.unwrap(row.2, ""), option.unwrap(row.3, ""), )) - Ok([]) -> { - wisp.log_error("Database query returned no rows unexpectedly.") - - Error("Unreachable entity") - } - Ok([_, _, ..]) -> { - wisp.log_error("Database query returned multiple rows unexpectedly.") - - Error("Unreachable entity") - } - Error(_) -> { - wisp.log_error("Database query failed.") + _ -> { + wisp.log_error("Database query failed or returned unexpected rows.") Error("Database operation failed") } -- cgit v1.2.3