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

Unified Diff: installer/src/installer-lib/handle.h

Issue 5665210325008384: Combine snapshot classes into a template class (Closed)
Patch Set: Created April 3, 2014, 4:51 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
« no previous file with comments | « installer/src/custom-action/close_application.cpp ('k') | installer/src/installer-lib/process.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: installer/src/installer-lib/handle.h
===================================================================
--- a/installer/src/installer-lib/handle.h
+++ b/installer/src/installer-lib/handle.h
@@ -141,11 +141,19 @@
return _handle ;
}
+ /**
+ * Error thrown when initialize or assigning a null handle against policy.
+ *
+ * Note that this error is a logic_error, not a runtime error.
+ * If it's against policy for a handle to be null, it's an error for the caller to try to make it null.
+ * Policy enforcment here is not a substitute for good error handling by the caller.
+ * In many cases, the caller ought to be throwing windows_api_error.
+ */
struct null_handle_error
- : public std::runtime_error
+ : public std::logic_error
{
null_handle_error()
- : std::runtime_error( "May not initialize with null handle" )
+ : std::logic_error( "May not initialize with null handle" )
{}
} ;
} ;
@@ -254,6 +262,10 @@
}
}
+ /**
+ * Expose the underlying handle type.
+ */
+ typedef T handle_type ;
} ;
//-------------------------------------------------------
« no previous file with comments | « installer/src/custom-action/close_application.cpp ('k') | installer/src/installer-lib/process.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld