]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
libvaladoc: @throws: Check for unthrown exceptions
authorFlorian Brosch <flo.brosch@gmail.com>
Sat, 21 Jul 2012 13:25:25 +0000 (15:25 +0200)
committerFlorian Brosch <flo.brosch@gmail.com>
Sat, 21 Jul 2012 13:25:25 +0000 (15:25 +0200)
src/libvaladoc/taglets/tagletthrows.vala

index 547fbc7ca6ed254a93f8425d92424368191febc4..986e797c9b170501cd9525fa564ae9c8ac6b9441 100644 (file)
@@ -43,6 +43,20 @@ public class Valadoc.Taglets.Throws : InlineContent, Taglet, Block {
                        reporter.simple_error ("%s does not exist", error_domain_name);
                }
 
+
+               Gee.List<Api.Node> 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);
        }