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?