Question about cURL: say I have the following code
class MyController {
public function index()
{
throw new \InvalidArgumentException('You shall not pass!!');
}
}
Now let's say that I want to call this piece of code via cURL:
// Create a curl handle to a non-existing location
$ch = curl_init('http://someUrl.net/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
if(curl_exec($ch) === false)
{
echo curl_error($ch);
}
// Close handle
curl_close($ch);
The code itself works fine, only I don't see my custom exception message. All I see is error code 500 and the following error message:
The requested URL returned error: 500 Internal Server Error
This message is not very helpful as I want to see what exactly went wrong. Is there a way to do this?