diff --git a/googletest/src/gtest-port.cc b/googletest/src/gtest-port.cc index 4f4f2d8b2..433586f3b 100644 --- a/googletest/src/gtest-port.cc +++ b/googletest/src/gtest-port.cc @@ -1095,10 +1095,12 @@ class CapturedStream { 0, // Generate unique file name. temp_file_path); GTEST_CHECK_(success != 0) - << "Unable to create a temporary file in " << temp_dir_path; + << "Failed to create temporary file in " << temp_dir_path + << " with error " << ::GetLastError(); const int captured_fd = creat(temp_file_path, _S_IREAD | _S_IWRITE); GTEST_CHECK_(captured_fd != -1) - << "Unable to open temporary file " << temp_file_path; + << "Failed to open temporary file " << temp_file_path << " with error " + << ::GetLastError(); filename_ = temp_file_path; #else // There's no guarantee that a test has write access to the current