Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force Laravel to Ignore Exception

When the below code, PHP should catch the exception and continue execution without throwing any error/exception page.

Question: However with Laravel 4, the exception page shows up. Setting app.debug to false only hides the stack trace. How do you force Laravel to ignore and continue execution?

 try
  {
      SomeOperation();
  }
  catch (SomeException $e)
  {
      // do nothing... php will ignore and continue    
  }
like image 237
Nyxynyx Avatar asked Apr 04 '13 21:04

Nyxynyx


People also ask

How do I disable error reporting in laravel?

You may turn off error details by setting the debug option in your app/config/app. php file to false .

What is abort in laravel?

The abort function throws an HTTP exception which will be rendered by the exception handler: abort(403) .

What is exception handling in laravel?

Reporting ExceptionsAll exceptions are handled by the App\Exceptions\Handler class. This class contains a register method where you may register custom exception reporting and rendering callbacks.


1 Answers

That can be a namespace problem.

Did you try to put a slash before the exception?

catch(\Exception $e)
{
   Log::error($e->getMessage());
}
like image 74
Gabriel Koerich Avatar answered Sep 20 '22 08:09

Gabriel Koerich