Raising errors without traceback
<p>I would like to use <code>raise</code> without printing the traceback on the screen. I know how to do that using <code>try ..catch</code> but doesn't find a way with <code>raise</code>.</p>

<p>Here is an example:</p>

<pre><code>def my_function(self):
    resp = self.resp
    if resp.status_code == 404:
        raise NoSuchElementError('GET'+self.url+'{}'.format(resp.status_code)) 
    elif resp.status_code == 500:
        raise ServerErrorError('GET'+self.url+'{}'.format(resp.status_code))
</code></pre>

<p>When executing this, if I have a 404, the traceback will print on the screen.</p>

<pre><code>Traceback (most recent call last):
  File "test.py", line 32, in &lt;module&gt;
    print ins.my_function()
  File "api.py", line 820, in my_function
    raise NoSuchElementError('GET ' + self.url + ' {} '.format(resp.status_code)) 
</code></pre>

<p>This is an API wrapper and I don't want users to see the traceback but to see the API response codes and error messages instead.</p>

<p>Is there a way to do it ? </p>