[commit] r2313 - in trunk/GME: Core Meta MgaUtil

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Thu Aug 29 11:19:21 CDT 2013


Author: ksmyth
Date: Thu Aug 29 11:19:20 2013
New Revision: 2313

Log:
Better IErrorInfo

Modified:
   trunk/GME/Core/CoreBinFile.cpp
   trunk/GME/Meta/MgaMetaProject.cpp
   trunk/GME/MgaUtil/MgaRegistrar.cpp

Modified: trunk/GME/Core/CoreBinFile.cpp
==============================================================================
--- trunk/GME/Core/CoreBinFile.cpp	Thu Aug 29 11:18:55 2013	(r2312)
+++ trunk/GME/Core/CoreBinFile.cpp	Thu Aug 29 11:19:20 2013	(r2313)
@@ -1006,8 +1006,12 @@
 		BOOL cancel = FALSE;
 		BOOL succ = CopyFileExA(origfname.c_str(), filenameout.c_str(), &prog, NULL, &cancel, 0);
 		if (!succ && GetLastError() != ERROR_REQUEST_ABORTED)
-			HR_THROW(HRESULT_FROM_WIN32(GetLastError()));
-
+		{
+			HRESULT hr = HRESULT_FROM_WIN32(GetLastError());
+			_bstr_t err;
+			GetErrorInfo(hr, err.GetAddress());
+			throw_com_error(hr, _bstr_t(L"Error saving '") + filenameout.c_str() + L"': " + err);
+		}
 	}
 	// TODO:
 	// GetNamedSecurityInfo(source, GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION)
@@ -1016,9 +1020,12 @@
 	ofs.clear();
 	ofs.open(filenameout.c_str(), std::ios::out | std::ios::binary);
 	if( ofs.fail() || !ofs.is_open() ) {
+		HRESULT hr = HRESULT_FROM_WIN32(GetLastError());
 		ofs.close();
 		ofs.clear();
-		HR_THROW(HRESULT_FROM_WIN32(GetLastError()));
+		_bstr_t err;
+		GetErrorInfo(hr, err.GetAddress());
+		throw_com_error(hr, _bstr_t(L"Error saving '") + filenameout.c_str() + L"': " + err);
 	}
 
 	write(metaprojectid);

Modified: trunk/GME/Meta/MgaMetaProject.cpp
==============================================================================
--- trunk/GME/Meta/MgaMetaProject.cpp	Thu Aug 29 11:18:55 2013	(r2312)
+++ trunk/GME/Meta/MgaMetaProject.cpp	Thu Aug 29 11:19:20 2013	(r2313)
@@ -181,7 +181,9 @@
 			COMTHROW(coreproject->get_UndoQueueSize(&undos));
 			if (undos)
 			{
-				COMTHROW(coreproject->SaveProject(L"", VARIANT_TRUE));
+				HRESULT hr = coreproject->SaveProject(L"", VARIANT_TRUE);
+				if (FAILED(hr))
+					return hr;
 			}
 			COMTHROW(coreproject->FlushRedoQueue());
 			COMTHROW(coreproject->FlushUndoQueue());

Modified: trunk/GME/MgaUtil/MgaRegistrar.cpp
==============================================================================
--- trunk/GME/MgaUtil/MgaRegistrar.cpp	Thu Aug 29 11:18:55 2013	(r2312)
+++ trunk/GME/MgaUtil/MgaRegistrar.cpp	Thu Aug 29 11:19:20 2013	(r2313)
@@ -1537,7 +1537,9 @@
 	{
 		CComBSTR connstr;
 		CComVariant guid;
-		COMTHROW(QueryParadigm(parname, &connstr, &guid, mode));
+		HRESULT hr = QueryParadigm(parname, &connstr, &guid, mode);
+		if (FAILED(hr))
+			return hr;
 		GUID g;
 		CopyTo(guid, g);
 		CopyTo(g, guidstr);


More information about the gme-commit mailing list