Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better explanation of implicit exception response status code #5669

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions reference/events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,12 @@ and set a new ``Exception`` object, or do nothing::
response won't work. If you want to overwrite the status code (which you
should not without a good reason), set the ``X-Status-Code`` header::

$response = Response(
$response = new Response(
'Error',
404 // ignored,
array('X-Status-Code' => 200)
404 // this status code will be ignored,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the comma should go after the 404 number to avoid syntax errors (previously was also wrong of course)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha, good catch :]

array(
'X-Status-Code' => 200 // this status code will actually be sent to the client
)
);

.. seealso::
Expand Down