/**
  * exception thrown when a method's input parameter has a type that cannot
  * be processed
  *
  * @param string  $type
  *        the data type that is not supported
  * @param integer $level
  *        how far up the call stack do we look for the name of the
  *        method that does not support this data type?
  */
 public function __construct($type, $level = 1)
 {
     // our list of args, in case someone wants to dig deeper into
     // what went wrong
     $data = $this->buildErrorData($type, $level);
     // what do we want to tell our error handler?
     $msg = $this->buildErrorMessage($data['type'], $data['caller']);
     // all done
     parent::__construct(400, $msg, $data);
 }
 public function __construct(ProcessResult $result)
 {
     $msg = "Command '" . $result->getCommandAsString() . ' succeeded with return code ' . $result->getReturnCode();
     parent::__construct(400, $msg, ['result' => $result]);
 }