/**
  * @inherit
  */
 public function handleError(\R3H6\Error404page\Domain\Model\Error $error)
 {
     $errorPage = $this->pageRepository->find404PageForError($error);
     if ($errorPage !== null) {
         $this->output = $this->httpService->readUrl($errorPage->getUrl());
         if ($this->output) {
             $this->cacheTags[] = 'pageId_' . $errorPage->getUid();
             return true;
         }
     }
     return false;
 }
 /**
  * @test
  */
 public function find404PageForErrorWillReturnLocalizedErrorPage()
 {
     /** @var \R3H6\Error404page\Domain\Model\Error $errorFixture */
     $errorFixture = $this->createError();
     $errorFixture->setLanguage(1);
     $pageRepository = $this->getInaccessibleProperty($this->pageRepository, 'pageRepository');
     $pageRepository->sys_language_uid = 1;
     $this->importDataSet('pages');
     $this->importDataSet('sys_language');
     $this->importPageRecord(array('uid' => 400, 'title' => 'Error Page', 'pid' => 1, 'doktype' => 104));
     $this->importPageLanguageOverlayRecord(array('uid' => 1, 'title' => 'Fehler Seite', 'pid' => 400, 'doktype' => 104, 'sys_language_uid' => 1, 't3_origuid' => 0));
     $errorPage = $this->pageRepository->find404PageForError($errorFixture);
     $this->assertInstanceOf('R3H6\\Error404page\\Domain\\Model\\Page', $errorPage);
     $this->assertEquals('Fehler Seite', $errorPage->getTitle(), 'Wrong page found!');
 }