[valadoc] libvaladoc: @throws: Check for unthrown exceptions



commit c43bb2308d62c558eac5708338b5a666c3fbfa66
Author: Florian Brosch <flo brosch gmail com>
Date:   Sat Jul 21 15:25:25 2012 +0200

    libvaladoc: @throws: Check for unthrown exceptions

 src/libvaladoc/taglets/tagletthrows.vala |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/libvaladoc/taglets/tagletthrows.vala b/src/libvaladoc/taglets/tagletthrows.vala
index 547fbc7..986e797 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<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);
 	}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]