clod986
clod986

Reputation: 2647

Catch Memory Exhausted error in Laravel

I would like to be able to catch the following error in laravel

PHP Fatal error:  Allowed memory size of 201326592 bytes exhausted

I currently use the following script in the globals in order to catch other errors, but this specific error seems to bypass it.

App::error(function (Exception $exception, $code) {}

Thanks

Upvotes: 5

Views: 3635

Answers (1)

clod986
clod986

Reputation: 2647

Turns out Laravel has a built in method to handle php fatal errors:

App::fatal(function($exception){});

See more on the laravel documentation

Thanks to @MarkBaker and @MateiMihai to help me understand better the situation.

Upvotes: 1

Related Questions