public static function render($file, $ex) : void
    {
        if (php_sapi_name() === 'cli') {
            exit(json_encode($ex));
        }

        http_response_code(500);
        require ouch_views($file);
        exit(1); //stop execution on first error
    }