Updated error handler to push exceptions to the log file