diff options
Diffstat (limited to '')
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/xml.erl | 10 |
2 files changed, 12 insertions, 1 deletions
@@ -1,5 +1,8 @@ 2009-04-27 Badlop <badlop@process-one.net> + * src/xml.erl: More verbose error reporting for + element_to_string (thanks to Magnus Henoch)(EJAB-301) + * src/translate.erl: Support additional files (EJAB-925) * contrib/extract_translations/extract_translations.erl: Likewise * contrib/extract_translations/prepare-translation.sh: Likewise diff --git a/src/xml.erl b/src/xml.erl index c55ca0d6e..846d93c9b 100644 --- a/src/xml.erl +++ b/src/xml.erl @@ -47,12 +47,20 @@ -endif. element_to_string(El) -> + case catch element_to_string_nocatch(El) of + {'EXIT', Reason} -> + erlang:error({badxml, El, Reason}); + Result -> + Result + end. + +element_to_string_nocatch(El) -> case El of {xmlelement, Name, Attrs, Els} -> if Els /= [] -> [$<, Name, attrs_to_list(Attrs), $>, - [element_to_string(E) || E <- Els], + [element_to_string_nocatch(E) || E <- Els], $<, $/, Name, $>]; true -> [$<, Name, attrs_to_list(Attrs), $/, $>] |