From: Florian Brosch Date: Sat, 21 Jul 2012 13:25:25 +0000 (+0200) Subject: libvaladoc: @throws: Check for unthrown exceptions X-Git-Tag: 0.37.1~3^2~193 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c43bb2308d62c558eac5708338b5a666c3fbfa66;p=thirdparty%2Fvala.git libvaladoc: @throws: Check for unthrown exceptions --- diff --git a/src/libvaladoc/taglets/tagletthrows.vala b/src/libvaladoc/taglets/tagletthrows.vala index 547fbc7ca..986e797c9 100644 --- a/src/libvaladoc/taglets/tagletthrows.vala +++ b/src/libvaladoc/taglets/tagletthrows.vala @@ -43,6 +43,20 @@ public class Valadoc.Taglets.Throws : InlineContent, Taglet, Block { reporter.simple_error ("%s does not exist", error_domain_name); } + + Gee.List exceptions = container.get_children_by_types ({Api.NodeType.ERROR_DOMAIN, Api.NodeType.CLASS}, false); + bool report_warning = true; + foreach (Api.Node exception in exceptions) { + if (exception == error_domain || exception is Api.Class) { + report_warning = false; + break; + } + } + if (report_warning) { + reporter.simple_warning ("%s does not exist in exception list", error_domain_name); + } + + base.check (api_root, container, file_path, reporter, settings); }