Generate a more informative error message