From 9aa867e8aacd7a44d03d2c737e292bed0a01516a Mon Sep 17 00:00:00 2001 From: Steven Qiu Date: Mon, 9 Mar 2026 20:21:43 +0800 Subject: [PATCH] refactor: do not catch exceptions when cannot read options --- app/Services/Option.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/app/Services/Option.php b/app/Services/Option.php index 5514fe38..87e11edc 100644 --- a/app/Services/Option.php +++ b/app/Services/Option.php @@ -20,13 +20,9 @@ class Option return; } - try { - $this->items = DB::table('options') - ->get() - ->mapWithKeys(fn ($item) => [$item->option_name => $item->option_value]); - } catch (QueryException $e) { - $this->items = collect(); - } + $this->items = DB::table('options') + ->get() + ->mapWithKeys(fn ($item) => [$item->option_name => $item->option_value]); } public function get($key, $default = null, $raw = false)