From b65ddab2d0499e00e2b0e4caebc2178433b25c5b Mon Sep 17 00:00:00 2001 From: Deon George Date: Fri, 10 May 2013 00:40:31 +1000 Subject: [PATCH] Improved exception handling --- classes/HTTP/Exception.php | 4 ++++ classes/lnApp/HTTP/Exception.php | 39 ++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 classes/HTTP/Exception.php create mode 100644 classes/lnApp/HTTP/Exception.php diff --git a/classes/HTTP/Exception.php b/classes/HTTP/Exception.php new file mode 100644 index 0000000..9518383 --- /dev/null +++ b/classes/HTTP/Exception.php @@ -0,0 +1,4 @@ + diff --git a/classes/lnApp/HTTP/Exception.php b/classes/lnApp/HTTP/Exception.php new file mode 100644 index 0000000..c405cf6 --- /dev/null +++ b/classes/lnApp/HTTP/Exception.php @@ -0,0 +1,39 @@ +type('file') + ->data('media/css/pages/error.css'); + + $output = '
'; + $output .= View::factory('errors/'.$this->_code) + ->set('message',$this->getMessage()); + + $output .= '
'; + $output .= HTML::anchor((URL::admin_url() ? 'u/' : '').'welcome',' Back to Home',array('class'=>'btn btn-large btn-primary')); + $output .= '
'; + $output .= '
'; + + $view = View::factory(Config::theme().'/page') + ->set('meta',new Meta) + ->set('navbar','') + ->set('content',$output); + + return Response::factory() + ->status($this->_code) + ->body($view); + + return $response; + } +} +?>