We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Phalcon\Debug return 200 OK

Why status of response with

$debug = new \Phalcon\Debug();
$debug->listen(true, true);

always has 200 OK? How I can send 500? If I want set development mode for app and send ajax request I have html body from debug tool and status 200(



13.8k

This code with $debug->debugVar sending 500 but I think it's sucks

switch (ENVIRONMENT)
{
    case 'local':
    case 'development':
        $debug = new \Phalcon\Debug();
        $debug->listen(true, true);
        $debug->debugVar([
            "response" => http_response_code(500)
        ]);
        error_reporting(E_ALL);
        ini_set('display_errors', 1);
    break;

    case 'testing':
    case 'production':
        ini_set('display_errors', 0);
        error_reporting(E_ALL & ~E_NOTICE);
    break;

    default:
        exit('The application environment is not set correctly.');
}


8.3k

...and prevents dumping errors into log files.

My topic: https://forum.phalcon.io/discussion/17749/phalcondebug-how-to-changeexpand-behaviour

I recommend other tool like whoops. Is anyone here who is responsible for communication forum <-> Phalcon team or we have to do it ourselves? I don't know how to contribute bugs or opinions.



13.8k
edited Feb '18

...and prevents dumping errors into log files.

Wow, it's very big trouble I think.

@phalcon Phalcon please answer