# Another only "200 response" question

**URL:** <https://discourse.slimframework.com/t/another-only-200-response-question/2205>\
**Category:** Questions\
**Created:** [January 31, 2018, 2:00pm UTC](https://discourse.slimframework.com/t/another-only-200-response-question/2205 "2018-01-31T14:00:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![antx](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@antx](https://discourse.slimframework.com/u/antx)\
**Post date:** [January 31, 2018, 2:00pm UTC](https://discourse.slimframework.com/t/another-only-200-response-question/2205/1 "2018-01-31T14:00:38Z")

</div>

I get a 200 status even when I set it to 500.

When I pass a simple string like:

`return $response->withStatus(500, "bli bla blo");`

I get my 500.

When I put that string into a variable like:

```
$x = "bli bla blo";
return $response->withStatus(500, $x);

```

I get my 500 as well.

But when I try use

```
return $response->withStatus(500, $e->getMessage());

```

I get a 200 instead of 500.

I tried to cast to string with (string)$e-\>getMessage() and concatinate that to a “test” but I still get a 200.

What could be going wrong here?

---

<div class="post-metadata">

**Author:** ![antx](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@antx](https://discourse.slimframework.com/u/antx)\
**Post date:** [January 31, 2018, 2:19pm UTC](https://discourse.slimframework.com/t/another-only-200-response-question/2205/2 "2018-01-31T14:19:52Z")

</div>

Okay, I found it:  
According to **rfc2616** Reason-Phrase can not contain CR and LF (\r \n). My variable had them apparently.

---

<div class="post-metadata">

**Author:** ![akrabat](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/akrabat/32/9_2.png) [@akrabat](https://discourse.slimframework.com/u/akrabat)\
**Post date:** [January 31, 2018, 3:01pm UTC](https://discourse.slimframework.com/t/another-only-200-response-question/2205/3 "2018-01-31T15:01:41Z")

</div>

Try: `return $response->withStatus(500)->write($e->getMessage()));` which will only work with Slim’s response object.
