Page MenuHomePhorge
Diviner libphutil Tech Docs PhutilAggregateException

class PhutilAggregateException
libphutil Technical Documentation (Errors)

Exception that aggregates other exceptions into a single exception. For example, if you have several objects which can perform a task and just want at least one of them to succeed, you can do something like this:

$exceptions = array();
$success = false;
foreach ($engines as $engine) {
  try {
    $engine->doSomething();
    $success = true;
    break;
  } catch (Exception $ex) {
    $exceptions[get_class($engine)] = $ex;
  }
}

if (!$success) {
  throw new PhutilAggregateException("All engines failed:", $exceptions);
}

Methods

public function __construct($message, $other_exceptions)

This method is not documented.
Parameters
$message
array$other_exceptions
Return
this//Implicit.//

public function getExceptions()

This method is not documented.
Return
wild