|
From: K. O. <web...@my...> - 2003-07-10 04:18:53
|
I agree that Xoops needs a centralized mechanism for handling errors.
Using the trigger_error/set_error_handler functions seem to be the way to
go.
- Kazu
----- Original Message -----
From: "R. Michael van Dam" <mv...@ca...>
To: <xoo...@li...>
Sent: Thursday, July 10, 2003 2:07 AM
Subject: [Xoops-development] addressing "blank page" problem
>
> Greetings,
>
> There has been a huge flurry of "blank page" posts on the forums in the
> past few months. I think we should do something about this... i.e. try
> and give a meaningful message instead of just the script failing.
>
> For example, in include/common.php... if the DatabaseFactory returns
> 'false', I think we should explicitly print an error and halt the script.
> (Even if the install goes perfectly, the database setup can change or the
> database can fail to restart when a machine is rebooted.)
> Otherwise people get the problem of 'call to a member of a non-object'
> later on which doesn't really identify the problem (for a non-programmer).
>
> I was about to add (after XoopsDatabaseFactory::get()) :
>
> if (false === $xoopsDB) {
> echo "ERROR: Could not connect to database. Please check your settings
> in mainfile.php";
> exit;
> }
>
> But it seems like maybe xoops could benefit from a centralized mechanism
> for doing this. Perhaps we can provide a custom error handler
> (set_error_handler) and use trigger_error? Or maybe the 'echo/exit'
> combination is good enough?
>
> Database failure seems to be the most common cause of the blank page
> problem... I'm not sure if we can catch many others... some are due to
> corrupt files (resulting in parse error or undefined function, which I
> don't think we can 'catch' with a custom error handler)...
>
> Any suggestions on the best way to do this?
>
> Best regards,
>
> Mike
>
>
|