I think your going to want to control errors and handle them in a particular way.
In which case I would
try{
// CODE THAT MAY THROW ERROR
$connection = new Connection('Grandmas_prosthetic_bluetooth_api');
$connection->getWalkingDistance();
}catch(){
// ON ERROR HANDLE
die('this is error happened because grandma wasn't around...');
// OR
echo json_encode(array(
'result' => 'failure',
'message' => 'bro something else bad happened...'
));
exit;
}
I like this cause if another script is calling this at least it can handle what happens when this script breaks like ajax calls or curls...
Else if your goal is to leave people not knowing anything you can just die() or exit();
If you need information about the error you should enable your error logs and tail them for the information, because in general exposing raw errors to the screen is really not great in practice.