Files
spa-api/app/Providers/ErrorServiceProvider.php

41 lines
941 B
PHP
Raw Normal View History

2014-08-20 00:10:30 -05:00
<?php namespace App\Providers;
2014-07-31 15:13:50 -05:00
2014-09-18 19:35:08 -05:00
use Exception;
use Illuminate\Contracts\Logging\Log;
2014-07-31 15:13:50 -05:00
use Illuminate\Support\ServiceProvider;
2014-09-18 19:35:08 -05:00
use Illuminate\Contracts\Exception\Handler;
2014-07-31 15:13:50 -05:00
class ErrorServiceProvider extends ServiceProvider {
/**
2014-08-12 11:58:09 -05:00
* Register any error handlers.
2014-07-31 15:13:50 -05:00
*
2014-09-18 19:35:08 -05:00
* @param Handler $handler
* @param Log $log
2014-07-31 15:13:50 -05:00
* @return void
*/
2014-09-18 19:35:08 -05:00
public function boot(Handler $handler, Log $log)
2014-07-31 15:13:50 -05:00
{
2014-08-11 10:13:20 -05:00
// Here you may handle any errors that occur in your application, including
// logging them or displaying custom views for specific errors. You may
// even register several error handlers to handle different types of
// exceptions. If nothing is returned, the default error view is
// shown, which includes a detailed stack trace during debug.
2014-09-18 19:35:08 -05:00
$handler->error(function(Exception $e) use ($log)
2014-08-11 10:13:20 -05:00
{
2014-09-18 19:35:08 -05:00
$log->error($e);
2014-08-11 10:13:20 -05:00
});
2014-07-31 15:13:50 -05:00
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
//
}
2014-09-21 20:31:42 +01:00
}