<commit_before><?php

class ErrorController extends Zend_Controller_Action 
{ 
    public function errorAction()
    { 
        $errors = $this->_getParam('error_handler');

        switch ($errors->type) {
            case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
            case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
                // 404 error -- controller or action not found
                $this->getResponse()->setRawHeader('HTTP/1.1 404 Not Found');
                $this->render('404');
                break;
            default:
                //application error !!
                $exception = $errors->exception;
                $log = "";
                $log .= "Error Message ---------------------------------------\n";
                $log .= $exception->getMessage()."\n\n";

                $log .= "Stack Trace -----------------------------------------\n";
                $log .= $exception->getTraceAsString()."\n\n";

                $log .= "Server Parameter ------------------------------------\n";<commit_msg>Added _REQUEST to error report (to capture what user has submitted)<commit_after><?php

class ErrorController extends Zend_Controller_Action 
{ 
    public function errorAction()
    { 
        $errors = $this->_getParam('error_handler');

        switch ($errors->type) {
            case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
            case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
                // 404 error -- controller or action not found
                $this->getResponse()->setRawHeader('HTTP/1.1 404 Not Found');
                $this->render('404');
                break;
            default:
                //application error !!
                $exception = $errors->exception;
                $log = "";
                $log .= "Error Message ---------------------------------------\n";
                $log .= $exception->getMessage()."\n\n";

                $log .= "Stack Trace -----------------------------------------\n";
                $log .= $exception->getTraceAsString()."\n\n";

                $log .= "REQUEST -----------------------------------------\n";
                $log .= print_r($_REQUEST, true)."\n\n";

                $log .= "Server Parameter ------------------------------------\n";
{'fraction_non_alphanumeric': 0.22991925201869953, 'fraction_numerical': 0.009349766255843604, 'mean_word_length': 1.2656400384985562, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1985306', 'n_tokens_mistral': 579, 'n_tokens_neox': 518, 'n_words': 117}