From e0c69d2e0ca0e3a82ac04ede422af8996c0d7ff9 Mon Sep 17 00:00:00 2001 From: xue <> Date: Sun, 20 Nov 2005 02:59:17 +0000 Subject: --- framework/Exceptions/TErrorHandler.php | 6 ++++-- framework/Exceptions/TException.php | 35 +++++++++++++--------------------- framework/Exceptions/messages.txt | 12 ++++++++++++ 3 files changed, 29 insertions(+), 24 deletions(-) (limited to 'framework/Exceptions') diff --git a/framework/Exceptions/TErrorHandler.php b/framework/Exceptions/TErrorHandler.php index d053619f..69166561 100644 --- a/framework/Exceptions/TErrorHandler.php +++ b/framework/Exceptions/TErrorHandler.php @@ -236,6 +236,7 @@ class TErrorHandler extends TComponent implements IModule $errorLine=$exception->getLine(); $beginLine=$errorLine-9>=0?$errorLine-9:0; $endLine=$errorLine+8<=count($lines)?$errorLine+8:count($lines); + $source=''; for($i=$beginLine;$i<$endLine;++$i) { @@ -247,6 +248,7 @@ class TErrorHandler extends TComponent implements IModule else $source.=highlight_string(sprintf("Line %4d: %s",$i+1,$lines[$i]),true); } + $fields=array( '%%ErrorType%%', '%%ErrorMessage%%', @@ -266,9 +268,9 @@ class TErrorHandler extends TComponent implements IModule strftime('%Y-%m-%d %H:%m',time()) ); $lang=Prado::getPreferredLanguage(); - $exceptionFile=$this->_templatePath.'/'.self::EXCEPTION_FILE_NAME.'-'.$lang.'.html'; + $exceptionFile=dirname(__FILE__).'/'.self::EXCEPTION_FILE_NAME.'-'.$lang.'.html'; if(!is_file($exceptionFile)) - $exceptionFile=$this->_templatePath.'/'.self::EXCEPTION_FILE_NAME.'.html'; + $exceptionFile=dirname(__FILE__).'/'.self::EXCEPTION_FILE_NAME.'.html'; if(($content=@file_get_contents($exceptionFile))===false) die("Unable to open exception template file '$exceptionFile'."); echo str_replace($fields,$values,$content); diff --git a/framework/Exceptions/TException.php b/framework/Exceptions/TException.php index 84ff1b89..49519f9f 100644 --- a/framework/Exceptions/TException.php +++ b/framework/Exceptions/TException.php @@ -16,15 +16,10 @@ * TException is the base class for all PRADO exceptions. * TException * TSystemException - * TNullReferenceException - * TIndexOutOfRangeException - * TArithmeticException - * TInvalidValueException - * TInvalidTypeException - * TInvalidFormatException + * TInvalidDataValueException + * TInvalidDataTypeException * TInvalidOperationException * TConfigurationException - * TSecurityException * TIOException * TDBException * THttpException @@ -88,51 +83,47 @@ class TApplicationException extends TException { } -class TNullReferenceException extends TSystemException -{ -} - -class TIndexOutOfRangeException extends TSystemException +class TInvalidOperationException extends TSystemException { } -class TArithmeticException extends TSystemException +class TInvalidDataTypeException extends TSystemException { } -class TInvalidOperationException extends TSystemException +class TInvalidDataValueException extends TSystemException { } -class TInvalidDataTypeException extends TSystemException +class TInvalidDataFormatException extends TSystemException { } -class TInvalidDataValueException extends TSystemException +class TConfigurationException extends TSystemException { } -class TInvalidDataFormatException extends TSystemException +class TIOException extends TSystemException { } -class TConfigurationException extends TSystemException +class TDBException extends TSystemException { } -class TIOException extends TException +class TSecurityException extends TSystemException { } -class TDBException extends TException +class TNotSupportedException extends TSystemException { } -class TSecurityException extends TException +class TTemplateParsingException extends TSystemException { } -class TNotSupportedException extends TException +class TTemplateRuntimeException extends TSystemException { } diff --git a/framework/Exceptions/messages.txt b/framework/Exceptions/messages.txt index 17e1e627..8df4dde1 100644 --- a/framework/Exceptions/messages.txt +++ b/framework/Exceptions/messages.txt @@ -60,6 +60,18 @@ errorhandler_errortemplatepath_invalid = TErrorHandler.ErrorTemplatePath '%s' is pageservice_page_unknown = Page '%s' Not Found +template_templatefile_invalid = Template file '%s' cannot open. +template_closingtag_unexpected = %s: Unexpected closing tag '%s' is found. +template_closingtag_expected = %s: Closing tag '%s' is expected. +template_directive_nonunique = %s: Directive '<%@ ... %>' must appear at most once in a template. +template_comments_forbidden = %s: Template comments are not allowed within property tags. +template_component_unknown = Component '%s' configured in template is not defined. +template_event_invalid = Event '%s.%s' configured in template is not defined. +template_property_readonly = Property '%s.%s' configured in template is read only. +template_attribute_unbindable = Attribute '%s.%s' configured in template cannot be bound to an expression. +template_property_undefined = Property '%s.%s' configured in template is not defined. +template_property_unbindable = Property '%s.%s' configured in template cannot be bound to an expression. Only properties of controls can be bound. +template_component_required = '%s' is not a component. Only components can be configured in template. body_contents_not_allowed = %s: body contents are not allowed. control_id_not_unique = Control ID '%s' is not unique for control type '%s'. -- cgit v1.2.3