Catch PDOException in OptionRepository

This commit is contained in:
printempw 2018-07-22 12:03:54 +08:00
parent 05cd77e963
commit 1597f0fac0

View File

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