From dd5471b8600a9a6efbfbfab81972db59e512493a Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 28 Sep 2009 21:05:07 -0700 Subject: Create and throw the exception, instead of logging. The theory behind exceptions is that they only need to be logged if they can't be caught and handled. If we don't throw it, then the error gets swallowed and the code that errored out just blithely continues. --- modules/gallery/helpers/gallery_error.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'modules') diff --git a/modules/gallery/helpers/gallery_error.php b/modules/gallery/helpers/gallery_error.php index 39568c93..551f8c63 100644 --- a/modules/gallery/helpers/gallery_error.php +++ b/modules/gallery/helpers/gallery_error.php @@ -24,9 +24,7 @@ class gallery_error_Core { } if (error_reporting() & $severity) { - $e = new ErrorException($message, 0, $severity, $filename, $lineno); - log::error("error", $e->getMessage()); - Kohana::log("error", $e->__toString()); + throw new ErrorException($message, 0, $severity, $filename, $lineno); } } } \ No newline at end of file -- cgit v1.2.3