mirror of
https://github.com/flarum/framework.git
synced 2025-04-26 06:34:06 +08:00
32 lines
898 B
PHP
32 lines
898 B
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of Flarum.
|
|
*
|
|
* (c) Toby Zerner <toby.zerner@gmail.com>
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Flarum\Foundation\ErrorHandling;
|
|
|
|
use Psr\Http\Message\ResponseInterface as Response;
|
|
use Psr\Http\Message\ServerRequestInterface as Request;
|
|
|
|
interface HttpFormatter
|
|
{
|
|
/**
|
|
* Create an HTTP Response to represent the error we are handling.
|
|
*
|
|
* This method receives the error that was caught by Flarum's error handling
|
|
* stack, along with the current HTTP request instance. It should return an
|
|
* HTTP response that explains or represents what went wrong.
|
|
*
|
|
* @param HandledError $error
|
|
* @param Request $request
|
|
* @return Response
|
|
*/
|
|
public function format(HandledError $error, Request $request): Response;
|
|
}
|