title: c++ inheriting library exceptions in another library to pass them to a calling code
body: <p>Consider the following situation: I have a library that includes a third party library. This third party library throws very nice, useful exceptions derived from <code>std::exception</code>. I'd like to communicate these exceptions to the code that calls my library, but I don't want to have to include the 3rd party library in the calling code, too. That 3rd party library could potentially change later on.</p>
  
  <p>It seems to make sense to create my own classes in my library that inherit from the third party exceptions, like so:</p>
  
  <pre><code>class myException: public thirdParty {};
  </code></pre>
  
  <p>Is there an easy way to catch an instance of thirdParty and copy it to myException? Later I may add capability to myException, but for now, I really just want to make thirdParty available to the calling code without including third party's library there. </p>
  
  <p>I do realize, of course, that the calling code will know about thirdParty because the headers from the third party library get included in my library header, which gets included in the calling code. But I'm trying to establish a contract that says, "Hey, these are the exceptions MY library throws. Later, I may swap out the third party lib, but I'm still going to throw exceptions that do what its exceptions did."</p>
  
  <p>Is this right? Is there a better way of doing this? Should I just have my calling code be aware of thirdParty exceptions?</p>