php - merge try/catch exceptions
<p>i'm trying to merge two exception objects into one.
Any idea how that works?</p>

<p>Here some pseudo code i have in mind:</p>

<pre><code>$objects = array();

try {
  // do something
  throw new Exception('Error One');
} catch(Exception $e) {
  $objects[] = $e;
}


try {
  // do something
  throw new Exception('Error Two');
} catch(Exception $e) {
  $objects[] = $e;
}

if(!empty($Objetcs)) {
  // now merge objects
  $new = merge($objects);

  throw $new;
}
</code></pre>

<p>Thanks in advance for your help!</p>
