Somehow I got some solution by Changing some lines in the function exception_handler()
Whole function is mentioned below
function exception_handler($exception)
{
$trace = $exception->getTrace();
$str_trace = "";
foreach ($trace as $line){
$str_trace .= $line['file']." at Line ".$line['line'] . "<br>";
}
error_handler(
E_ERROR,
sprintf(_("Unhandled exception [%s]: %s. %s."), $exception->getCode(), $exception->getMessage(), $str_trace),
$exception->getFile(),
$exception->getLine()
);
end_page();
}