When I ran my batch file and get Excetion below:
I try to catch exception but I can not catch. My code sample is below:
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
try {
$sql = '';
$connection = $this->_resource->getConnection();
$result = $connection->fetchAll($sql);
....
}
catch (Exception $e) {
$this->writeErrorLog($e->getMessage());
}
}
But I can't not get message of Exception. So that, Anyone show me How to get message of Exception to write log?