From 1597f0fac00080dfb25faf1577e74616a29a8410 Mon Sep 17 00:00:00 2001 From: printempw Date: Sun, 22 Jul 2018 12:03:54 +0800 Subject: [PATCH] Catch PDOException in OptionRepository --- app/Services/Repositories/OptionRepository.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/Services/Repositories/OptionRepository.php b/app/Services/Repositories/OptionRepository.php index 901622ff..30bbe73c 100644 --- a/app/Services/Repositories/OptionRepository.php +++ b/app/Services/Repositories/OptionRepository.php @@ -3,6 +3,7 @@ namespace App\Services\Repositories; use DB; +use PDOException; use Illuminate\Support\Arr; use Illuminate\Database\QueryException; @@ -17,7 +18,9 @@ class OptionRepository extends Repository { try { $options = DB::table('options')->get(); - } catch (QueryException $e) { + } catch (Exception $e) { + $options = []; + } catch (PDOException $e) { $options = []; } @@ -103,6 +106,8 @@ class OptionRepository extends Repository } } catch (QueryException $e) { return; + } catch (PDOException $e) { + return; } } @@ -132,6 +137,8 @@ class OptionRepository extends Repository $this->itemsModified = []; } catch (QueryException $e) { return; + } catch (PDOException $e) { + return; } }