jeudi 29 mars 2018

Laravel 5.5 Try / Catch is not working it's execute the exception handle

I am working with laravel 5.5 I have written a code with try and catch exception. But Try / catch is not manage exception handling. Exception execute on the Exception/handle.php

Here is code I am following

try {
 App\Models\justDoIt::find(1);
}  catch (\Exception $ex) {
       dd($ex);
       report($ex);
       return false;
}

I would like to know why catch is not executed and trow error to the handle.php in report()

Here is the handle.php code

public function report(Exception $exception) {
        echo "Handle";
        dd($exception);
        parent::report($exception);
    }

Result

Handle
FatalThrowableError {#284 ▼
  #message: "Class 'App\Http\Controllers\App\Models\justDoIt' not found"
  #code: 0
  #file: "D:\xampp7\htdocs\homeexpert_nik\app\Http\Controllers\HomeController.php"
  #line: 21
  #severity: E_ERROR
  trace: {▶}
}

Result will show from the handle.php file.



from Newest questions tagged laravel-5 - Stack Overflow http://bit.ly/2J1JU4y
via IFTTT

Aucun commentaire:

Enregistrer un commentaire