protected function getWhoopsHandler(): WhoopsHandlerInterface
	{
		if($this->returnAsJson())
		{
			return new JsonResponseHandler;
		}

		if($this->returnAsXml())
		{
			return new XmlResponseHandler;
		}

		$handler = new PrettyPageHandler;

		$handler->handleUnconditionally(true);

		$handler->setApplicationPaths([$this->app->getPath()]);

		$handler->setPageTitle('Error');

		$blacklist = $this->app->getConfig()->get('application.error_handler.debug_blacklist');

		if(!empty($blacklist))
		{
			foreach($blacklist as $superglobal => $keys)
			{
				foreach($keys as $key)
				{
					$handler->blacklist($superglobal, $key);
				}
			}
		}

		return $handler;
	}