Handle fatal errors and log the details.