Share » Forums » Install & configuration » unexpected error and ErrorDocument...

unexpected error and ErrorDocument 500 template

unexpected error and ErrorDocument 500 template

Thursday 21 October 2010 3:06:01 am - 4 replies

Author Message

André R.

Thursday 21 October 2010 4:47:39 am

That error is using and exception and not template, so you can't override the view of those I'm afraid.

Do you often have to turn of your sql server for some reason?

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Jean-Raphael Frydman

Thursday 21 October 2010 5:16:56 am

Hello André,

In case the SQL server crashes, it would be better to have a userfriendly page than the error message on a blank page.
Is there any way to catch the exception and to send another page ?

thanks

JR

André R.

Thursday 21 October 2010 7:49:03 am

you can try by using ouput filter, but don't think the exception is currently catched so think you'll need to hack index.php and do that your self if you need it.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Jean-Raphael Frydman

Monday 25 October 2010 3:28:21 am

Well, it almost works.

I have put this code in lib/ezutils/classes/ezexecution.php from line 195, in the defaultExceptionHandler function

what do you think ?
I still have some problems with the include of img in the html source, maybe a rewrite rule in the apache vhost config file.

static public function defaultExceptionHandler( Exception $e )    
{        if( PHP_SAPI != 'cli' )        
         {
            header( 'HTTP/1.x 500 Internal Server Error' );
            header( 'Content-Type: text/html' );
///////////            
          if ( $documentRoot )
            {                
             self::$eZDocumentRoot = $documentRoot;            }
             else if ( self::$eZDocumentRoot === null )
            {
             self::$eZDocumentRoot = getcwd();            }
            
            chdir( self::$eZDocumentRoot );

            $stringerror = file_get_contents('./errorpages/erreur_500.html', true);
            $splitString = str_split($stringerror, 8192);
            foreach($splitString as $chunk)
                echo $chunk;

///////////
           if( eZDebug::isDebugEnabled() )
//[...]

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu