throw new \Exception('Il y a une erreur !');
Voir :
* [[prog:symfony:exceptions]]
===== Try =====
==== PHP ====
try {
$response = $this->get($uri);
} catch (\Exception $e) {
// Penser à logger l'erreur.
return ['error' => 'Les informations ne sont pas disponibles pour le moment.'];
}