1
0
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:
Franz Liedke
2019-08-20 19:41:51 +02:00
parent 9f15e9ba86
commit 6c454b8279
8 changed files with 72 additions and 0 deletions

View File

@@ -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
{
/**