Skip to content

Commit

Permalink
[tools] gen_settings: error if a handler but no module attribute is s…
Browse files Browse the repository at this point in the history
…pecified

previously it just silently ignored the handler, which is really really bad!
  • Loading branch information
flixr committed Aug 5, 2012
1 parent 585b98b commit 6b32de4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions sw/tools/gen_settings.ml
Expand Up @@ -81,9 +81,14 @@ let print_dl_settings = fun settings ->
let v = ExtXml.attrib s "var" in
begin
try
let h = ExtXml.attrib s "handler" and
m = ExtXml.attrib s "module" in
lprintf "case %d: %s_%s( _value ); _value = %s; break;\\\n" !idx (Filename.basename m) h v
let h = ExtXml.attrib s "handler" in
begin
try
let m = ExtXml.attrib s "module" in
lprintf "case %d: %s_%s( _value ); _value = %s; break;\\\n" !idx (Filename.basename m) h v
with
ExtXml.Error e -> prerr_endline (sprintf "Error: You need to specify the module attribute for setting %s to use the handler %s" v h); exit 1
end;
with
ExtXml.Error e -> lprintf "case %d: %s = _value; break;\\\n" !idx v
end;
Expand Down

0 comments on commit 6b32de4

Please sign in to comment.