protected function renderSerializerAsJson(BaseSerializerException $error) {
		// Set the view class as json and render as json
		$this->controller->viewClass = 'Json';
		$this->controller->response->type('json');
		$this->controller->response->statusCode($error->status());

		// set all the values we have from our exception to populate the json object
		$this->controller->set('id', h($error->id()));
		$this->controller->set('href', h($error->href()));
		$this->controller->set('status', h($error->status()));
		$this->controller->set('code', h($error->code()));
		$this->controller->set('title', h($error->title()));
		$this->controller->set('detail', h($error->detail()));
		$this->controller->set('links', h($error->links()));
		$this->controller->set('paths', h($error->paths()));

		$this->controller->set('_serialize', array(
			'id', 'href', 'status', 'code', 'title ', 'detail', 'links', 'paths'
		));

		if (empty($template)) {
			$template = "SerializersErrors./Errors/serializer_exception";
		}

		$this->controller->render($template);
		$this->controller->afterFilter();
		return $this->controller->response->send();
	}