public function getError(\DataFilter\Attribute $attrib = null)
    {
        if ($this->error === false) {
            return null;
        }
        if (!$attrib) {
            $attrib = $this->attrib;
        }
        $formatData = array('rule' => $this->name);
        if ($attrib) {
            $formatData['attrib'] = $attrib->getName();
        }
        $error = $this->error;
        if (!$error && $attrib) {
            $error = $attrib->getDefaultErrorStr();
        }
        if (!$error) {
            $error = $this->dataFilter->getErrorTemplate();
        }
        return U::formatString($error, $formatData);
    }