laravel 7 catch exception 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();
}