title: Handling catch exception on php
body: <p>How do I to store a exception error message in a session? I tried something like below, but the execution is interrupted with exception message and don't set my SESSION.</p>
  
  <pre><code>catch(MyServiceException $e) {
      $_SESSION['status']['mensagem_servidor'] = $e-&gt;getMessage();
  }
  </code></pre>
  
  <p>I'm receiving a "maximum execution time error" from a curl script, the server gets busy and don't send me the response. I need to handle this message to create a customized message.</p>