2019-11-22 12:49:14 -06:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
2020-01-01 14:11:53 -06:00
|
|
|
use Laminas\Stratigility\Middleware\ErrorHandler;
|
|
|
|
use Mezzio\ProblemDetails\ProblemDetailsMiddleware;
|
2019-11-22 12:49:14 -06:00
|
|
|
use Shlinkio\Shlink\Common\Logger;
|
|
|
|
|
|
|
|
return [
|
|
|
|
|
2019-12-30 15:42:29 -06:00
|
|
|
'problem-details' => [
|
|
|
|
'default_types_map' => [
|
2019-11-24 05:41:12 -06:00
|
|
|
404 => 'NOT_FOUND',
|
|
|
|
500 => 'INTERNAL_SERVER_ERROR',
|
|
|
|
],
|
2019-12-30 15:42:29 -06:00
|
|
|
],
|
|
|
|
|
2019-11-22 12:49:14 -06:00
|
|
|
'error_handler' => [
|
|
|
|
'listeners' => [Logger\ErrorLogger::class],
|
|
|
|
],
|
|
|
|
|
|
|
|
'dependencies' => [
|
|
|
|
'delegators' => [
|
|
|
|
ErrorHandler::class => [
|
|
|
|
Logger\ErrorHandlerListenerAttachingDelegator::class,
|
|
|
|
],
|
|
|
|
ProblemDetailsMiddleware::class => [
|
|
|
|
Logger\ErrorHandlerListenerAttachingDelegator::class,
|
|
|
|
],
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
];
|