src/page.php
public function exception($exception, $user_message=null) {
	if ($exception instanceof \Exception == false) {
		return $this->error('unknown exception format', response::STATUS_INTERNAL_SERVER_ERROR);
	}
	
	$exception_class = bootstrap::get_library('exception');
	
	$this->data['exception']['current'] = $exception;
	$this->data['exception']['current_trace_string'] = $exception_class::clean_paths(nl2br($exception->getTraceAsString()));
	
	$previous = $exception->getPrevious();
	if ($previous) {
		$this->data['exception']['previous'] = $previous;
		$this->data['exception']['previous_trace_string'] = $exception_class::clean_paths(nl2br($previous->getTraceAsString()));
	}
	
	$reason = $exception->getMessage();
	$code   = $exception->getCode();
	$this->error($reason, $code, $user_message);
}
public function exception($exception, $user_message=null) {
	if ($exception instanceof \Exception == false) {
		return $this->error('unknown exception format', response::STATUS_INTERNAL_SERVER_ERROR);
	}
	
	$exception_class = bootstrap::get_library('exception');
	
	$this->data['exception']['current'] = $exception;
	$this->data['exception']['current_trace_string'] = $exception_class::clean_paths(nl2br($exception->getTraceAsString()));
	
	$previous = $exception->getPrevious();
	if ($previous) {
		$this->data['exception']['previous'] = $previous;
		$this->data['exception']['previous_trace_string'] = $exception_class::clean_paths(nl2br($previous->getTraceAsString()));
	}
	
	$reason = $exception->getMessage();
	$code   = $exception->getCode();
	$this->error($reason, $code, $user_message);
}
public function exception ( $ exception , $ user_message = null ) { if ( $ exception instanceof \ Exception == false ) { return $ this -> error ( 'unknown exception format' , response :: STATUS_INTERNAL_SERVER_ERROR ) ; } $ exception_class = bootstrap :: get_library ( 'exception' ) ; $ this -> data [ 'exception' ] [ 'current' ] = $ exception ; $ this -> data [ 'exception' ] [ 'current_trace_string' ] = $ exception_class :: clean_paths ( nl2br ( $ exception -> getTraceAsString ( ) ) ) ; $ previous = $ exception -> getPrevious ( ) ; if ( $ previous ) { $ this -> data [ 'exception' ] [ 'previous' ] = $ previous ; $ this -> data [ 'exception' ] [ 'previous_trace_string' ] = $ exception_class :: clean_paths ( nl2br ( $ previous -> getTraceAsString ( ) ) ) ; } $ reason = $ exception -> getMessage ( ) ; $ code = $ exception -> getCode ( ) ; $ this -> error ( $ reason , $ code , $ user_message ) ; }
show an error page using an exception

@param  object $exception    one that extends \Exception
@param  string $user_message optional, human-friendly message to show to the user
@return void                 script execution terminates
show an error page using an exception