Default message in custom exception - Python : <p>I want to create a custom exception in Python, that when raised without any arguments, it will print a default message.</p>

<p>Case Example:</p>

<pre><code>&gt;&gt;&gt; class CustomException(Exception):
       # some code here

&gt;&gt;&gt; raise CustomException
</code></pre>

<p>and get the below output:</p>

<pre><code>Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
__main__.CustomException: This is a default message!
</code></pre>
