Skip to content

Commit d64e993

Browse files
committed
minor #5669 Better explanation of implicit exception response status code (hvt)
This PR was squashed before being merged into the 2.3 branch (closes #5669). Discussion ---------- Better explanation of implicit exception response status code | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | all | Fixed tickets | none Commits ------- 54f77d8 Better explanation of implicit exception response status code
2 parents 3c0036e + 54f77d8 commit d64e993

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)