title: Codeigniter: same global exception showing several times
body: <p>I am using codeigniter &amp; displaying global exception with the help of php by  extending Exception class</p>
  
  <p><strong>Now the problem is:</strong>  on the same page the exception message(see screenshot) is showing several times depending on the number of exception generated... i want to show only message to user at browser...</p>
  
  <p>How can i make to show only one message in the browser ?</p>
  
  <p><strong>Code from where exception message is generating</strong>
      
  
  <pre><code>    function __construct() {
          parent::__construct();
      } 
  
      function log_exception($severity, $message, $filepath, $line) {
  
          if (ENVIRONMENT === 'production') {
              $to = "developer@example.com";
              $subject = "Fitness Trainer -Production Exception";
              $message = 'Severity: ' . $severity . '  --&gt; ' . $message . ' ' . $filepath . '&lt;br/&gt; ' . $line;
              $from = "robot@gmail.com";
              $headers = "From:" . $from;
              mail($to, $subject, $message, $headers);
              echo '&lt;div  style="width: 70%;text-align: left;margin-left: 15%;" class="alert alert-warning text-center alert-dismissible server-side-msg text-capitalize"   role="alert"&gt;
                  &lt;span class="glyphicon glyphicon-warning-sign"&gt;&lt;/span&gt;
                  &lt;strong&gt;We apologize for the inconvenience,An exception occurred from our side and will work to resolve it....
                  &lt;/strong&gt;
                  &lt;button type="button" class="close" data-dismiss="alert"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;span class="sr-only"&gt;Close&lt;/span&gt;&lt;/button&gt;
              &lt;/div&gt;';
          }  
          parent::log_exception($severity, $message, $filepath, $line);
      } 
  }?&gt;
  </code></pre>
  
  <p><strong>Screenshot of Repeated  Message</strong>
  <img src="https://i.stack.imgur.com/bsEA5.jpg" alt="enter image description here"></p>