From: Niels De Graef Date: Sat, 18 Feb 2023 20:32:52 +0000 (+0100) Subject: gtkmodule: Improve error messages X-Git-Tag: 0.56.5~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0b4b3d8cc07836c2f24ba96db3f49c84305eb54a;p=thirdparty%2Fvala.git gtkmodule: Improve error messages Be a bit more specific about some of the errors that valac can encounter when parsing a UI file. (for my use case specifically, it helped me to figure out I had a tag without a name attribute in one of my UI files) --- diff --git a/codegen/valagtkmodule.vala b/codegen/valagtkmodule.vala index e129fcba0..69125ce57 100644 --- a/codegen/valagtkmodule.vala +++ b/codegen/valagtkmodule.vala @@ -294,7 +294,7 @@ public class Vala.GtkModule : GSignalModule { } else if (current_object != null && current_token == MarkupTokenType.START_ELEMENT && (current_name == "property" || current_name == "binding")) { var property_name = reader.get_attribute ("name"); if (property_name == null) { - Report.error (node.source_reference, "Invalid binding in ui file `%s'", ui_file); + Report.error (node.source_reference, "Invalid %s without name in ui file `%s'", current_name, ui_file); current_token = reader.read_token (null, null); continue; } @@ -318,7 +318,7 @@ public class Vala.GtkModule : GSignalModule { if (current_property != null) { if (handler_name == null) { - Report.error (node.source_reference, "Invalid closure in ui file `%s'", ui_file); + Report.error (node.source_reference, "Invalid %s without function in ui file `%s'", current_name, ui_file); current_token = reader.read_token (null, null); continue; }