Validation error variable is protected

Permalink
This is my output when trying to display the error in my single_page:
ValidationErrorHelper Object
(
    [error:protected] => Array
        (
            [0] => Invalid email address provided.
        )
)

Im using this code to set the value:
public function on_start() {
      $this->error = Loader::helper('validation/error');
   }
   public function on_before_render() {
      if ($this->error->has()) {
         $this->set('error', $this->error);
      }
   }
   public function check_email() {
      $email = $this->post('uEmail');
      $vals = Loader::helper('validation/strings');
      $valc = Loader::helper('concrete/validation');
      if (!$vals->email($email)) {
         $this->error->add(t('Invalid email address provided.'));
      }

I can't display the error if it is protected. Is there anyway to unprotect it so that I can display it?

baskettcase
 
baskettcase replied on at Permalink Best Answer Reply
baskettcase
Ok looks like I figured it out, this was the line that needed to be changed
$this->set('error', $this->error->output());