I have code that makes db calls and network requests, and I wrapped them in try / catch. The problem is that I can never catch exceptions, and they don't seem to be fatal exceptions:
try { // make db requests and network calls } catch (Exception $e) { // handle exception }
Namely, I encounter exceptions such as:
[Illuminate\Database\QueryException] [PDOException] [InvalidArgumentException]
Is there any way to catch these exceptions? Do I need to be explicit for every possible type of exception object (which means I have to create many attempts / catch), or is there a recommended way to catch non-fatal exceptions?
php exception eloquent laravel laravel-5
Joel Joel Binks
source share