diff options
author | Badlop <badlop@process-one.net> | 2009-04-27 21:36:41 +0000 |
---|---|---|
committer | Badlop <badlop@process-one.net> | 2009-04-27 21:36:41 +0000 |
commit | e45e486fd24aecfb8967326e6237cb6fb6e6a618 (patch) | |
tree | 5ef166f5a38f9f514b2a0a714c63848e86781a6a /src/xml.erl | |
parent | * src/translate.erl: Support additional files (EJAB-925) (diff) |
* src/xml.erl: More verbose error reporting for
element_to_string (thanks to Magnus Henoch)(EJAB-301)
SVN Revision: 2045
Diffstat (limited to '')
-rw-r--r-- | src/xml.erl | 10 |
1 files changed, 9 insertions, 1 deletions
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), $/, $>] |