title: How do I raise the same Exception with a custom message in Python?
body: <p>I have this <code>try</code> block in my code:</p>
  
  <pre><code>try:
      do_something_that_might_raise_an_exception()
  except ValueError as err:
      errmsg = 'My custom error message.'
      raise ValueError(errmsg)
  </code></pre>
  
  <p>Strictly speaking, I am actually raising <em>another</em> <code>ValueError</code>, not the <code>ValueError</code> thrown by <code>do_something...()</code>, which is referred to as <code>err</code> in this case. How do I attach a custom message to <code>err</code>? I try the following code but fails due to <code>err</code>, a <code>ValueError</code> <strong>instance</strong>, not being callable:</p>
  
  <pre><code>try:
      do_something_that_might_raise_an_exception()
  except ValueError as err:
      errmsg = 'My custom error message.'
      raise err(errmsg)
  </code></pre>