c++ - Throwing multiple exceptions of the same type
<p>So I've got a program with two exception. In both cases, I'd like to throw a string that can be caught in the main function and used in an error message. However, from what I know about them</p>

<pre><code>    try {
     ...
    } catch(string msg) {
     cerr &lt;&lt; "..." &lt;&lt; msg &lt;&lt; "..." &lt;&lt; endl;
    } catch (string msg2) {
     cerr &lt;&lt; "..." &lt;&lt; msg2 &lt;&lt; "..." &lt;&lt; endl;
    }
</code></pre>

<p>isn't allowed. Is there any way I could do the above or something like it?
Thanks</p>