Change document title to error message if there's a problem.