'Return a list of internal consistency errors (if any) for the
database.'

def check(self):

    errors = []
    for corruption in self.corruptions:
        errors.append(("database    corruption    during    '%s':    %s    (resolution:    %s)" % corruption))
    if (self.version != self.VERSION):
        errors.append(("VERSION    mismatch:    current    DB    version,    '%s',    is    not    the    latest,    '%s'" % (self.version, self.VERSION)))
    errors += self._check_catalogszone()
    for lang in self._gen_langs_in_db():
        if (not self.mgr.is_citadel_lang(lang)):
            continue
        lang_zone = self._get_lang_zone(lang)
        if (not exists(lang_zone.base_dir)):
            continue
        if isinstance(lang_zone, MultiLangZone):
            errors += self._check_multilangzone(lang_zone)
        else:
            errors += self._check_langzone(lang_zone)
    projs_dir = join(self.base_dir, 'db', 'projs')
    if exists(projs_dir):
        for dir in [join(projs_dir, d) for d in os.listdir(projs_dir)]:
            if (not isdir(dir)):
                continue
            errors += self._check_proj_dir(dir)
    return errors
