You are here

class BackupMigrateException in Backup and Migrate 8.4

Class BackupMigrateException.

@package BackupMigrate\Core\Exception

Hierarchy

Expanded class hierarchy of BackupMigrateException

9 files declare their use of BackupMigrateException
BackupMigrate.php in lib/backup_migrate_core/src/Main/BackupMigrate.php
DrupalDirectoryDestination.php in src/Destination/DrupalDirectoryDestination.php
DrupalUtils.php in src/Filter/DrupalUtils.php
FileDirectorySource.php in lib/backup_migrate_core/src/Source/FileDirectorySource.php
MySQLiSource.php in lib/backup_migrate_core/src/Source/MySQLiSource.php

... See full list

File

lib/backup_migrate_core/src/Exception/BackupMigrateException.php, line 12

Namespace

BackupMigrate\Core\Exception
View source
class BackupMigrateException extends Exception {
  protected $replacement = [];
  protected $message_raw = 'Unknown exception';

  /**
   * Construct the exception. Note: The message is NOT binary safe.
   *
   * @link http://php.net/manual/en/exception.construct.php
   * @param string $message [optional] The Exception message to throw.
   * @param array $replacement [optional] Untranslatable values to replace into the string.
   * @param int $code [optional] The Exception code.
   */
  public function __construct($message = NULL, $replacement = [], $code = 0) {
    $this->replacement = $replacement;
    $this->message_raw = $message;

    // Send the replaced message to the parent constructor to act as normal in most cases.
    parent::__construct(strtr($message, $replacement), $code);
  }

  /**
   * Get the unmodified message with replacement tokens.
   *
   * @return null|string
   */
  public function getMessageRaw() {
    return $this->message_raw;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BackupMigrateException::$message_raw protected property
BackupMigrateException::$replacement protected property
BackupMigrateException::getMessageRaw public function Get the unmodified message with replacement tokens.
BackupMigrateException::__construct public function Construct the exception. Note: The message is NOT binary safe.