1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

wrap into try catch

This commit is contained in:
Benjamin Beganović 2020-11-24 11:52:01 +01:00
parent 242d48cd1a
commit 549fd92671

View File

@ -53,7 +53,13 @@ class SetupController extends Controller
public function doSetup(StoreSetupRequest $request)
{
try {
$check = SystemHealth::check(false);
} catch (\Exception $e) {
info(['message' => $e->getMessage(), 'action' => 'SetupController::doSetup()']);
return response()->json(['message' => $e->getMessage()], 400);
}
if ($check['system_health'] === false) {
info($check);
@ -141,6 +147,7 @@ class SetupController extends Controller
*/
public function checkDB(CheckDatabaseRequest $request): Response
{
try {
$status = SystemHealth::dbCheck($request);
if (is_array($status) && $status['success'] === true) {
@ -148,6 +155,11 @@ class SetupController extends Controller
}
return response($status, 400);
} catch (\Exception $e) {
info(['message' => $e->getMessage(), 'action' => 'SetupController::checkDB()']);
return response()->json(['message' => $e->getMessage()], 400);
}
}
/**