Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

response: code and status options ignored #36

Open
krewetka opened this issue Jan 17, 2015 · 3 comments
Open

response: code and status options ignored #36

krewetka opened this issue Jan 17, 2015 · 3 comments

Comments

@krewetka
Copy link

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
Copy link
Author

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
Copy link
Author

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 krewetka reopened this Jan 17, 2015
@vajiralasantha
Copy link

Anybody found a solution for this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants