# wpide/3.4.3/App/Controllers/ErrorController.php

WPIDE – File Manager &amp; Code Editor, version 3.4.3. 27 lines.

- Page: https://pluginprobe.com/plugins/wpide/3.4.3/code/App/Controllers/ErrorController.php
- Raw: https://pluginprobe.com/plugins/wpide/3.4.3/raw/App/Controllers/ErrorController.php
- Modified: 2022-07-30T20:33:10+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wpide/3.4.3/code/App/Controllers/ErrorController.php#L10-L20`.

```php
<?php

namespace WPIDE\App\Controllers;

use WPIDE\App\Kernel\Request;
use WPIDE\App\Kernel\Response;

class ErrorController
{
    protected $request_type;

    public function __construct(Request $request)
    {
        $this->request_type = $request->getContentType();
    }

    public function notFound(Response $response)
    {
        return $this->request_type == 'json' ? $response->json('Not Found', 404) : $response->html('Not Found', 404);
    }

    public function methodNotAllowed(Response $response)
    {
        return $this->request_type == 'json' ? $response->json('Not Allowed', 401) : $response->html('Not Found', 401);
    }
}

```
