title: How to throw an array exception in php
body: <p>So I have an error message that gets thrown in one file</p>
  
  <pre><code>$error_message = "Error received for " . $service . ": " . $_r['status'] . "\n" . "Message received: " . $_r['errors'];
  throw new My_Exception($error_message);
  </code></pre>
  
  <p>and in another file I have </p>
  
  <blockquote>
  <pre><code>try {
      //blah blah
  } catch( My_Exception $e ) { 
      var_export($e-&gt;getMessage());
  }
  </code></pre>
  </blockquote>
  
  <p>The problem, however, is that $_r['errors'] is an ARRAY and it get $e->getMessage() just prints it as "Array". How can I modify this code to access the array?</p>