diff options
Diffstat (limited to 'src/xmpp_stream_in.erl')
-rw-r--r-- | src/xmpp_stream_in.erl | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/src/xmpp_stream_in.erl b/src/xmpp_stream_in.erl index 675425bd0..29e0d1016 100644 --- a/src/xmpp_stream_in.erl +++ b/src/xmpp_stream_in.erl @@ -196,10 +196,10 @@ format_error({socket, Reason}) -> format("Connection failed: ~s", [format_inet_error(Reason)]); format_error({stream, reset}) -> <<"Stream reset by peer">>; -format_error({stream, {in, #stream_error{reason = Reason, text = Txt}}}) -> - format("Stream closed by peer: ~s", [format_stream_error(Reason, Txt)]); -format_error({stream, {out, #stream_error{reason = Reason, text = Txt}}}) -> - format("Stream closed by us: ~s", [format_stream_error(Reason, Txt)]); +format_error({stream, {in, #stream_error{} = Err}}) -> + format("Stream closed by peer: ~s", [xmpp:format_stream_error(Err)]); +format_error({stream, {out, #stream_error{} = Err}}) -> + format("Stream closed by us: ~s", [xmpp:format_stream_error(Err)]); format_error({tls, Reason}) -> format("TLS failed: ~s", [format_tls_error(Reason)]); format_error(internal_failure) -> @@ -1156,20 +1156,6 @@ format_inet_error(Reason) -> Txt -> Txt end. --spec format_stream_error(atom() | 'see-other-host'(), [text()]) -> string(). -format_stream_error(Reason, Txt) -> - Slogan = case Reason of - undefined -> "no reason"; - #'see-other-host'{} -> "see-other-host"; - _ -> atom_to_list(Reason) - end, - case xmpp:get_text(Txt) of - <<"">> -> - Slogan; - Data -> - binary_to_list(Data) ++ " (" ++ Slogan ++ ")" - end. - -spec format_sasl_error(cyrsasl:mechanism(), atom()) -> {atom(), binary()}. format_sasl_error(<<"EXTERNAL">>, Err) -> xmpp_stream_pkix:format_error(Err); |