Permalink
Browse files

Remove Prophet class and added Prophet_Exception for issue #1

  • Loading branch information...
lukemorton committed Jan 11, 2011
1 parent e6744b0 commit 7b058c54e55d7cc17cf0a214ac832905453b5028
Showing with 1 addition and 38 deletions.
  1. +0 −38 classes/prophet.php
  2. +1 −0 classes/prophet/exception.php
View
@@ -1,38 +0,0 @@
-<?php defined('SYSPATH') or die('No direct script access.');
-
-class Prophet {
-
- public static function exception_handler(Exception $e)
- {
- if (Kohana::$environment === Kohana::DEVELOPMENT)
- {
- Kohana_Exception::handler($e);
- }
-
- // It's a nice time to log :)
- Kohana::$log->add(Kohana_Log::ERROR, Kohana_Exception::text($e));
-
- if ( ! defined('SUPPRESS_REQUEST'))
- {
- $request = array(
- // Get status from current request
- 'action' => Request::current()->status(),
-
- // If exception has a message this can be passed on
- 'message' => rawurlencode($e->getMessage()),
- );
-
- // Override status if HTTP_Exception thrown
- if ($e instanceof HTTP_Exception)
- {
- $request['action'] = $e->getCode();
- }
-
- echo Request::factory(Route::get('prophet_error')->uri($request))
- ->execute()
- ->send_headers()
- ->response;
- }
- }
-
-}
@@ -0,0 +1 @@
+<?php defined('SYSPATH') or die('No direct script access.');class Prophet_Exception { public static function handler(Exception $e) { if (Kohana::$environment === Kohana::DEVELOPMENT) { Kohana_Exception::handler($e); } // It's a nice time to log :) Kohana::$log->add(Kohana_Log::ERROR, Kohana_Exception::text($e)); if ( ! defined('SUPPRESS_REQUEST')) { $request = array( // Get status from current request 'action' => Request::current()->status(), // If exception has a message this can be passed on 'message' => rawurlencode($e->getMessage()), ); // Override status if HTTP_Exception thrown if ($e instanceof HTTP_Exception) { $request['action'] = $e->getCode(); } echo Request::factory(Route::get('prophet_error')->uri($request)) ->execute() ->send_headers() ->response; } } }

0 comments on commit 7b058c5

Please sign in to comment.