Skip to content
Browse files

Ensure an initial request object exists before firing an error sub-re…

…quest.
  • Loading branch information...
1 parent c8fa0a9 commit 0a9348fb903084fce866a017c4845e44824a745d @leth committed Jun 26, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 guide/kohana/tutorials/error-pages.md
View
6 guide/kohana/tutorials/error-pages.md
@@ -37,6 +37,12 @@ Our custom exception handler is self explanatory.
$params['action'] = $e->getCode();
}
+ // If an exception happens in bootstrap, we might not have a request object.
+ if ( ! Request::$initial)
+ {
+ Request::factory();
+ }
+
// Error sub-request.
echo Request::factory(Route::get('error')->uri($params))
->execute()

0 comments on commit 0a9348f

Please sign in to comment.
Something went wrong with that request. Please try again.