Skip to content

Commit

Permalink
wrap in exception
Browse files Browse the repository at this point in the history
  • Loading branch information
ildyria committed Sep 14, 2024
1 parent 9c071bd commit 4aa951b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/Http/Controllers/Admin/Maintenance/Optimize.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ class Optimize extends Controller
*/
public function do(MaintenanceRequest $request, OptimizeDb $optimizeDb, OptimizeTables $optimizeTables): array
{
return collect($optimizeDb->do())
try {
return collect($optimizeDb->do())
->merge(collect($optimizeTables->do()))
->all();
} catch (\Exception $e) {
return [$e->getMessage()];
}
}
}

0 comments on commit 4aa951b

Please sign in to comment.