Broad Exception Catch (ARCH7153)
Key php.logging.catch-generic-throwable · Severity info · Category logging
Catching the most general exception type (\Throwable, \Exception) masks unrelated failures alongside the expected one and hides the real problem.
Incorrect
Section titled “Incorrect”<?phptry { $user = $this->repository->find($id);} catch (\Throwable $e) { return null;}Correct
Section titled “Correct”<?phptry { $user = $this->repository->find($id);} catch (EntityNotFoundException $e) { return null;}Catch only the specific exception types you can actually handle.