1
0
mirror of https://github.com/flarum/core.git synced 2025-08-04 23:47:32 +02:00

Log errors that occur in the API stack

This takes place only in the FallbackExceptionHandler. Having a custom
exception handler implies that a friendly message is displayed in the
API response, in which case we can bet that the exception won't need to
be "debugged" per se.
This commit is contained in:
Toby Zerner
2018-11-11 18:00:57 +10:30
parent 903c1e329d
commit 222e3c3fe2
2 changed files with 80 additions and 2 deletions

View File

@@ -25,7 +25,6 @@ use Flarum\Http\RouteCollection;
use Flarum\Http\RouteHandlerFactory;
use Flarum\Http\UrlGenerator;
use Tobscure\JsonApi\ErrorHandler;
use Tobscure\JsonApi\Exception\Handler\FallbackExceptionHandler;
use Tobscure\JsonApi\Exception\Handler\InvalidParameterExceptionHandler;
use Zend\Stratigility\MiddlewarePipe;
@@ -80,7 +79,7 @@ class ApiServiceProvider extends AbstractServiceProvider
$handler->registerHandler(new ExceptionHandler\TokenMismatchExceptionHandler);
$handler->registerHandler(new ExceptionHandler\ValidationExceptionHandler);
$handler->registerHandler(new InvalidParameterExceptionHandler);
$handler->registerHandler(new FallbackExceptionHandler($this->app->inDebugMode()));
$handler->registerHandler(new ExceptionHandler\FallbackExceptionHandler($this->app->inDebugMode(), $this->app->make('log')));
return $handler;
});