Improved exception handling
This commit is contained in:
parent
42059cb0e5
commit
b65ddab2d0
4
classes/HTTP/Exception.php
Normal file
4
classes/HTTP/Exception.php
Normal file
@ -0,0 +1,4 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
class HTTP_Exception extends lnApp_HTTP_Exception {}
|
||||
?>
|
39
classes/lnApp/HTTP/Exception.php
Normal file
39
classes/lnApp/HTTP/Exception.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* This class overrides Kohana's HTTP Exception
|
||||
*
|
||||
* @package lnApp/Modifications
|
||||
* @category Exception
|
||||
* @author Deon George
|
||||
* @copyright (c) 2009-2013 Open Source Billing
|
||||
* @license http://dev.leenooks.net/license.html
|
||||
*/
|
||||
abstract class lnApp_HTTP_Exception extends Kohana_HTTP_Exception {
|
||||
public function get_response() {
|
||||
Style::factory()
|
||||
->type('file')
|
||||
->data('media/css/pages/error.css');
|
||||
|
||||
$output = '<div class="container"><div class="row"><div class="error-container">';
|
||||
$output .= View::factory('errors/'.$this->_code)
|
||||
->set('message',$this->getMessage());
|
||||
|
||||
$output .= '<div class="error-actions">';
|
||||
$output .= HTML::anchor((URL::admin_url() ? 'u/' : '').'welcome','<i class="icon-chevron-left"></i> Back to Home',array('class'=>'btn btn-large btn-primary'));
|
||||
$output .= '</div>';
|
||||
$output .= '</div></div></div>';
|
||||
|
||||
$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;
|
||||
}
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user