public function withError(int $status, $data, bool $as_json = null): self
    {
        $is_data_error = $data && $this->App->c::isError($data);

        if (!isset($as_json) && $is_data_error) {
            $as_json = $this->App->c::isApi() || $this->App->c::isAjax();
        }
        if ($as_json) { // Format as JSON?
            $data         = $is_data_error ? $data : null;
            $Error        = $data ?: $this->App->c::error();
            $content_type = 'application/json';
            $content      = json_encode([
                'success' => false,
                'error'   => [
                    'code'    => $status,
                    'slug'    => $Error->slug(),
                    'message' => $Error->message(),
                ],
            ], JSON_PRETTY_PRINT);
        } else {
            $data         = is_string($data) ? $data : '';
            $content      = $data ?: $this->App->c::statusHeaderMessage($status);
            $content_type = 'text/'.($this->App->c::isHtml($content, true) ? 'html' : 'plain');
        }
        $clone = $this->withStatus($status);
        $clone = $clone->withHeader('content-type', $content_type.'; charset=utf-8');

        $Body         = $this->App->c::createReponseBody($content);
        return $clone = $clone->withBody($Body);
    }