Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: installer/src/installer-lib/database.cpp

Issue 6197445574787072: Cleaned up CA exceptions. Integrated free-standing handle class. (Closed)
Patch Set: Created March 30, 2014, 7:43 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: installer/src/installer-lib/database.cpp
===================================================================
--- a/installer/src/installer-lib/database.cpp
+++ b/installer/src/installer-lib/database.cpp
@@ -14,11 +14,11 @@
UINT x = MsiDatabaseOpenView( handle, query, & view_handle ) ;
if ( x == ERROR_BAD_QUERY_SYNTAX )
{
- throw std::runtime_error( "Bad MSI query syntax" ) ;
+ throw windows_api_error( "MsiDatabaseOpenView", "ERROR_BAD_QUERY_SYNTAX" ) ;
}
else if ( x == ERROR_INVALID_HANDLE )
{
- throw std::runtime_error( "Invalid handle" ) ;
+ throw windows_api_error( "MsiDatabaseOpenView", "ERROR_INVALID_HANDLE" ) ;
}
return msi_handle( view_handle ) ;
}
@@ -39,7 +39,7 @@
MSIHANDLE h( MsiGetActiveDatabase( session.handle ) ) ;
if ( h == 0 )
{
- throw std::runtime_error( "Failed to retrieve active databases" ) ;
+ throw windows_api_error( "MsiGetActiveDatabase", 0 ) ;
}
return msi_handle( h ) ;
}
@@ -64,7 +64,7 @@
{
if ( x != ERROR_SUCCESS )
{
- throw std::runtime_error( "MsiViewExecute call failed" ) ;
+ throw windows_api_error( "MsiViewExecute", x ) ;
}
}
@@ -92,6 +92,6 @@
{
return Record( msi_handle( h ) ) ;
}
- throw std::runtime_error( "Error fetch record from view" ) ;
+ throw windows_api_error( "MsiViewFetch", x ) ;
}

Powered by Google App Engine
This is Rietveld