feat: refactor code and improve readability

This commit is contained in:
Rico van Zelst
2025-03-04 12:50:19 +01:00
parent efc263e257
commit 68d18311b4
8 changed files with 25 additions and 34 deletions

View File

@@ -27,12 +27,12 @@ class SaleController extends Controller
return $response;
});
} catch (\Exception $e) {
if ($e->getMessage() === 'Trying to access array offset on value of type null') {
} catch (\Exception $exception) {
if ($exception->getMessage() === 'Trying to access array offset on value of type null') {
logger()->error('LMI has broken');
abort(503, 'Sorry, the Sale Rotation is currently under maintenance. Please try again later.');
} else {
logger()->error('An error occurred while trying to fetch the Sale Rotation', ['error' => $e->getMessage()]);
logger()->error('An error occurred while trying to fetch the Sale Rotation', ['error' => $exception->getMessage()]);
abort(500, 'Sorry, an error occurred while trying to fetch the Sale Rotation. Please try again later.');
}
}