1
0
mirror of https://github.com/flarum/core.git synced 2025-08-06 00:17:31 +02:00

Support multiple error reporters

The error handling middleware now expects an array of reporters.
Extensions can register new reporters in the container like this:

    use Flarum\Foundation\ErrorHandling\Reporter;

    $container->tag(NewReporter::class, Reporter::class);

Note that this is just an implementation detail and will be hidden
behind an extender.
This commit is contained in:
Franz Liedke
2019-08-10 11:03:44 +02:00
parent 9f71e2c3cb
commit d06493c61e
6 changed files with 12 additions and 11 deletions

View File

@@ -53,7 +53,7 @@ class ApiServiceProvider extends AbstractServiceProvider
$pipe->pipe(new HttpMiddleware\HandleErrors(
$app->make(Registry::class),
$app->make(JsonApiRenderer::class),
$app->make(Reporter::class)
$app->tagged(Reporter::class)
));
$pipe->pipe($app->make(HttpMiddleware\ParseJsonBody::class));