You are here

function Messaging_Message::set_error in Messaging 6.4

Same name and namespace in other branches
  1. 6.3 classes/messaging_message.class.inc \Messaging_Message::set_error()
  2. 7 messaging.message.inc \Messaging_Message::set_error()

Set error condition and stop processing

Parameters

$text: Error message to be stored

2 calls to Messaging_Message::set_error()
Messaging_Message::save in includes/messaging_message.class.inc
Save to store / update
Messaging_Message::set_user in includes/messaging_message.class.inc
Set user object and related properties

File

includes/messaging_message.class.inc, line 583
Drupal Messaging Framework - Message class file

Class

Messaging_Message
Message class

Code

function set_error($text = 'ERROR', $code = 1) {

  // This will stop processing if we are in the middle of anything
  $this->process = FALSE;
  $this->success = FALSE;
  $this->error = $code;
  $this->error_msg = $text;
  $this
    ->message_log('Error processing message.');

  // By default, messages are set to be logged when errors happen
  if ($this->log_error) {
    $this->log = 1;
    $this->updated = TRUE;
  }
  elseif (!$this->log) {

    // Not for logging, discard
    $this->discard = TRUE;
  }
}