title: How to forward a thrown expression from one catch block to another?
body: <p>I am writing a program in C++ which handles errors via throwing strings (either <code>std::string</code> or <code>const char*</code>), like so :</p>
  
  <pre><code>if (/* failure condition 1 */)
      throw std::string("Error 1 : ...") + std::to_string(foo);
  
  if (/* failure condition 2 */)
      throw "Error 2 : ...";
  </code></pre>
  
  <p>Then I would catch them this way :</p>
  
  <pre><code>try {
      thisIsLikelyToThrowErrors();
  } catch (const std::string&amp; e) {
      std::cerr &lt;&lt; ":( " &lt;&lt; e &lt;&lt; std::endl;
  } catch (const char* e) {
      std::cerr &lt;&lt; ":( " &lt;&lt; e &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p>I would like to avoid writing the same line twice, by forwarding the string from the first <code>catch</code> block to the second one :</p>
  
  <pre><code>try {
      thisIsLikelyToThrowErrors();
  } catch (const std::string&amp; e) {
      throw e.c_str(); // Does not work
  } catch (const char* e) {
      std::cerr &lt;&lt; ":( " &lt;&lt; e &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p>However this code won't work, the thrown <code>char const*</code> simply won't be catched.</p>
  
  <p>Is there a way to do this?</p>
  
  <p>Thanks :)</p>