mirror of
https://github.com/flarum/core.git
synced 2025-10-18 10:16:09 +02:00
Error handling: Document classes and interfaces
This commit is contained in:
@@ -18,6 +18,17 @@ use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
use Zend\Diactoros\Response\HtmlResponse;
|
||||
|
||||
/**
|
||||
* A formatter for turning caught exceptions into "pretty" HTML error pages.
|
||||
*
|
||||
* For certain known error types, we display pages with dedicated information
|
||||
* relevant to this class of error, e.g. a page with a search form for HTTP 404
|
||||
* "Not Found" errors. We look for templates in the `views/error` directory.
|
||||
*
|
||||
* If no specific template exists, a generic "Something went wrong" page will be
|
||||
* displayed, optionally enriched with a more specific error message if found in
|
||||
* the translation files.
|
||||
*/
|
||||
class ViewFormatter implements HttpFormatter
|
||||
{
|
||||
/**
|
||||
|
Reference in New Issue
Block a user