public function mergeMessages(Result $other, $errorsAsWarnings = false)
    {
        if ($this->getException() === null && $other->getException() !== null) {
            $this->setException($other->getException());
        }
        if ($errorsAsWarnings) {
            $this->addWarnings($other->getErrors());
        } else {
            $this->addErrors($other->getErrors());
        }
        return $this->addWarnings($other->getWarnings())->addNotices($other->getNotices());
    }