Skip to content

Commit f00b72e

Browse files
committed
Add ErrorResponseGeneratorInterface
1 parent 0e1a0aa commit f00b72e

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

src/.gitkeep

Whitespace-only changes.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace HttpSoft\ErrorHandler;
6+
7+
use Psr\Http\Message\ResponseInterface;
8+
use Psr\Http\Message\ServerRequestInterface;
9+
use Throwable;
10+
11+
interface ErrorResponseGeneratorInterface
12+
{
13+
/**
14+
* Generates an instance of `Psr\Http\Message\ResponseInterface` with information about the handled error.
15+
*
16+
* @param Throwable $error
17+
* @param ServerRequestInterface $request
18+
* @return ResponseInterface
19+
*/
20+
public function generate(Throwable $error, ServerRequestInterface $request): ResponseInterface;
21+
}

0 commit comments

Comments
 (0)