Pass the diagnostic in for better error messages.