diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-08-08 12:46:26 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-08-08 12:46:26 -0700 |
commit | 3c7dc6d7a63e59c841f60d9594575efcf0969f98 (patch) | |
tree | 9cf00a9f6d0371183219310df07528feb5242310 /modules/gallery | |
parent | ded9ed4df809d28ba2f4519a398e06daf335ee81 (diff) |
Handle 404 exceptions specially to reduce spam in the log files. Fixes ticket #1228.
Diffstat (limited to 'modules/gallery')
-rw-r--r-- | modules/gallery/libraries/MY_Kohana_Exception.php | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/modules/gallery/libraries/MY_Kohana_Exception.php b/modules/gallery/libraries/MY_Kohana_Exception.php index 27d1afc1..82899d7e 100644 --- a/modules/gallery/libraries/MY_Kohana_Exception.php +++ b/modules/gallery/libraries/MY_Kohana_Exception.php @@ -22,11 +22,15 @@ class Kohana_Exception extends Kohana_Exception_Core { * Dump out the full stack trace as part of the text representation of the exception. */ public static function text($e) { - return sprintf( - "%s [ %s ]: %s\n%s [ %s ]\n%s", - get_class($e), $e->getCode(), strip_tags($e->getMessage()), - $e->getFile(), $e->getLine(), - $e->getTraceAsString()); + if ($e instanceof Kohana_404_Exception) { + return "File not found: " . Router::$complete_uri; + } else { + return sprintf( + "%s [ %s ]: %s\n%s [ %s ]\n%s", + get_class($e), $e->getCode(), strip_tags($e->getMessage()), + $e->getFile(), $e->getLine(), + $e->getTraceAsString()); + } } /** |