LexikMaintenanceBundle icon indicating copy to clipboard operation
LexikMaintenanceBundle copied to clipboard

response: code and status options ignored

Open krewetka opened this issue 10 years ago • 3 comments

In docs there is part about:

 #Optional. response code and status of the mantainence page
    response:
        code: 503 
        status: "Service Temporarily Unavailable"    

I see $response->setStatusCode($this->http_code, $this->http_status); in code but somehow whatever I do I get

503 Service Unavailable - ServiceUnavailableException

to the browser in the end

krewetka avatar Jan 17 '15 18:01 krewetka

I checked and what I see displayed in browser is code from:

    {
        parent::__construct(503, $message, $previous, array(), $code);
    }

If I change code number or message there it returns specified code and message.

I tried debugging it and theoretically in app_dev.php message is returned with specified code but symfony displays code specified in constructor of ServiceUnavailableException.

Wouldn't it be good to return there Exception with code from config and not always 503?

krewetka avatar Jan 17 '15 18:01 krewetka

Ok, I thought that I can at least put that code and status from config on my custom 503 error page.

But when I put there The server returned a "{{ status_code }} {{ status_text }}" I also get : The server returned a "503 Service Unavailable".

How to use these custom code and status?

I see it displayed in firebug but can't access it in any way to show it to user.

krewetka avatar Jan 17 '15 18:01 krewetka

Anybody found a solution for this?

vajiralasantha avatar Jan 08 '18 03:01 vajiralasantha