You are here

public function SyncException::getRootException in CMS Content Sync 2.0.x

Same name and namespace in other branches
  1. 8 src/Exception/SyncException.php \Drupal\cms_content_sync\Exception\SyncException::getRootException()
  2. 2.1.x src/Exception/SyncException.php \Drupal\cms_content_sync\Exception\SyncException::getRootException()

Parameters

bool $nested:

Return value

null|\Exception

File

src/Exception/SyncException.php, line 82

Class

SyncException
Class SyncException, thrown if anything goes wrong during pull / push of entities for Content Sync. Will be caught by the Flow synchronization class, saved to the logs, presented to the user and returned to Sync Core.

Namespace

Drupal\cms_content_sync\Exception

Code

public function getRootException($nested = false) {
  if ($this->parentException) {
    if ($this->parentException instanceof SyncException) {
      return $this->parentException
        ->getRootException(true);
    }
    return $this->parentException;
  }
  if ($nested) {
    return $this;
  }
  return null;
}