public function getActionError($key = null) {
        $errors = $this->getAttribute(ACTION_ERRORS_KEY);

        if ($key === null) {                            // return the first one
            if ($errors) {
                foreach ($errors as $error) return $error;
            }
        }
        elseif (key_exists($key, $errors)) {            // return the specified one
            return $errors[$key];
        }
        return null;
    }