This topic is locked

error catch

4/10/2018 4:02:19 PM
PHPRunner General questions
C
carlos.oschi@gmail.com author

Well, first of all, this is a hack over the source code of PHP, so be carefull, and of course this is at your own risk!!.
a) first step of all, backup the phprunner folder (maybe in c:\program files\phprunner9.8), i am using 64 version.
<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=25475&image=1&table=forumtopics' class='bbc_emoticon' alt='B)' /> locate the file ./include/phpfunctions.php
c) in the file look for this portion of code
if ( !$globalSettings["showDetailedError"] )
Maybe at line 1150 (but it can diferent in another phprunner version)
this IF contains the response over the custom error message, so, i change it for this
include_once('./addon/funciones.php'); <-- my main functions file
$url = $_SERVER["SERVER_NAME"].$_SERVER["SCRIPT_NAME"];

if(array_key_exists("QUERY_STRING",$_SERVER))

{

$url .= "?".runner_htmlspecialchars($_SERVER["QUERY_STRING"]);

}
$debugInfoArr = parse_backtrace($errfile, $errline);

echo f_mensaje_error($errno, $errstr, $errfile, $errline, $url, $strLastSQL, $debugInfoArr);

exit(0);
the function f_mensaje_error returns a single and full page with all structure (html, head, body, etc) using the variables that phprunner provides for the standard message of error.
Plus i change the default mail sending method to mandrill from mailchimp. So i get noticed with with the debug data error and no my customer, this provide some visual over errors in the background.
the last step is tell to phprunner to uncheck the show detailed error messsage to force the use of this "IF"
remember 1, this is a hack over the main source code, so all your projects will have this new feature.

remember 2, when a new version of phprunner came, this modification will lost, so take notes and backup allways.