xxxxxxxxxx
try {
$this->buildXMLHeader();
} catch (\Exception $e) {
return $e->getMessage();
}
xxxxxxxxxx
use Exception;
use Illuminate\Database\QueryException;
try {
} catch (Exception $e) {
return $e->getMessage();
} catch (QueryException $e) {
return $e->getMessage();
}
xxxxxxxxxx
try
{
// what do you want to do?
}
catch (Exception $e)
{
//what do you want to do or say if an error is thrown?
}