Better handling of xml parse errors in send_stanza

This commit is contained in:
Paweł Chmielowski 2020-03-23 12:59:30 +01:00
parent a2d1ffffe6
commit 63e3fb92d1
1 changed files with 3 additions and 0 deletions

View File

@ -1513,6 +1513,9 @@ send_stanza(FromString, ToString, Stanza) ->
catch _:{xmpp_codec, Why} ->
io:format("incorrect stanza: ~ts~n", [xmpp:format_error(Why)]),
{error, Why};
_:{badmatch, {error, {Code, Why}}} when is_integer(Code) ->
io:format("invalid xml: ~p~n", [Why]),
{error, Why};
_:{badmatch, {error, Why}} ->
io:format("invalid xml: ~p~n", [Why]),
{error, Why};