Skip to content

Commit 0308c6b

Browse files
committed
Releasing 1.0.0
2 parents 0a93bd2 + 6a7697d commit 0308c6b

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

src/WebApp/Application.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,10 @@ public function getMenu($id = NULL) {
329329
return NULL;
330330
}
331331

332+
public function getErrorPage($httpCode, $text, $throwable = NULL) {
333+
return NULL;
334+
}
335+
332336
/**
333337
* Persist any error message in the database.
334338
*/

src/WebApp/Service.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ public function run() {
3535
}
3636
} catch (\Throwable $e) {
3737
\TgLog\Log::error('Cannot create application', $e);
38-
$page = new Error\ErrorPage($this->app, 500, 'Internal Error', $e);
38+
$page = $this->theme->getErrorPage(500, 'Internal Error', $e);
39+
// $page = new Error\ErrorPage($this->app, 500, 'Internal Error', $e);
3940
$page->processRequest();
4041
$this->theme->render($page);
4142
}
@@ -63,7 +64,7 @@ protected function createPage() {
6364

6465
// Get a specific error page from the theme
6566
if ($page == NULL) {
66-
$page = $this->theme->getErrorPage(404);
67+
$page = $this->theme->getErrorPage(404, 'Error');
6768
}
6869

6970
// Get the default error page
@@ -73,7 +74,8 @@ protected function createPage() {
7374
return $page;
7475
} catch (\Throwable $e) {
7576
\TgLog\Log::error('Cannot create application', $e);
76-
return new Error\ErrorPage($this->app, 500, 'Internal Error', $e);
77+
return $this->theme->getErrorPage(500, 'Internal Error', $e);
78+
//return new Error\ErrorPage($this->app, 500, 'Internal Error', $e);
7779
}
7880
}
7981

src/WebApp/Theme.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,10 @@ public function hasFeature($name) {
183183
return in_array($name, $this->features);
184184
}
185185

186-
public function getErrorPage($htmlCode) {
187-
$name = '\\WebApp\\Error\\ErrorPage';
188-
return new $name($this->app, $htmlCode, 'Error');
186+
public function getErrorPage($htmlCode, $text, $throwable = NULL) {
187+
$rc = $this->app->getErrorPage($htmlCode, $text, $throwable);
188+
if ($rc == NULL) $rc = new \WebApp\Error\ErrorPage($this->app, $htmlCode, $text, $throwable);
189+
return $rc;
189190
}
190191
}
191192

src/i18n.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
),
132132
'error_page_title' => array(
133133
'de' => 'Gratulation!',
134-
'en' => 'Congratulation!',
134+
'en' => 'Congrats!',
135135
),
136136
'error_page_subtitle' => array(
137137
'de' => 'Jetzt habt Ihr die Seite kaputt gemacht.',

0 commit comments

Comments
 (0)