try catch in laravel controller code example
Example: try and catch laravel
try {
$this->buildXMLHeader();
} catch (\Exception $e) {
return $e->getMessage();
}
try {
$this->buildXMLHeader();
} catch (\Exception $e) {
return $e->getMessage();
}