Yes, that will work; it’s a bit extreme at times.
You can just create an error reporting function in your snippet, really all the messageQuit does is determine what message to display, dresses it up in its own HTML, echos it and logs it, then exits. Here’s the end of the function:
echo $parsedMessageString;
ob_end_flush();
// Log error
$this->logEvent(0, 3, $parsedMessageString, $source= 'Parser');
// Make sure and die!
exit();
}
The whole function is near the end of the document.parser.class.inc.php file.