Best practice for translating exceptions in C++/CLI wrapper class
问题 I am writing a .NET wrapper class for an existing native class which throws exceptions. What are the best practices for translating between native C++ exceptions and Managed exceptions? Catch and re-throw on a one-to-one basis (e.g. std::invalid_argument -> System.System.ArgumentException)? Is there a mapping already drawn up somewhere? 回答1: There is no standard mapping that I know of. What I've done in the past is translate the ones I know about, and a catch block for System.Runtime