You are here

public function BynderException::displayMessage in Bynder 8

Same name and namespace in other branches
  1. 8.3 src/Exception/BynderException.php \Drupal\bynder\Exception\BynderException::displayMessage()
  2. 8.2 src/Exception/BynderException.php \Drupal\bynder\Exception\BynderException::displayMessage()
  3. 4.0.x src/Exception/BynderException.php \Drupal\bynder\Exception\BynderException::displayMessage()

Displays message to the user.

File

src/Exception/BynderException.php, line 68

Class

BynderException
Base exception class for Bynder.

Namespace

Drupal\bynder\Exception

Code

public function displayMessage() {
  if (\Drupal::currentUser()
    ->hasPermission($this->adminPermission)) {
    drupal_set_message($this->adminMessage, $this->messageLevel);
  }
  else {
    drupal_set_message($this
      ->getMessage(), $this->messageLevel);
  }
}