Skip to content

Commit 54f77d8

Browse files
hvtwouterj
authored andcommitted
Better explanation of implicit exception response status code
1 parent cf68425 commit 54f77d8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

reference/events.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,12 @@ and set a new ``Exception`` object, or do nothing::
215215
response won't work. If you want to overwrite the status code (which you
216216
should not without a good reason), set the ``X-Status-Code`` header::
217217

218-
$response = Response(
218+
$response = new Response(
219219
'Error',
220-
404 // ignored,
221-
array('X-Status-Code' => 200)
220+
404, // this status code will be ignored
221+
array(
222+
'X-Status-Code' => 200 // this status code will actually be sent to the client
223+
)
222224
);
223225

224226
.. seealso::

0 commit comments

Comments
 (0)