diff --git a/src/gen_iq_handler.erl b/src/gen_iq_handler.erl index b815a1c19..d34db3588 100644 --- a/src/gen_iq_handler.erl +++ b/src/gen_iq_handler.erl @@ -164,7 +164,7 @@ process_iq(Module, Function, #iq{lang = Lang, sub_els = [El]} = IQ) -> end, Module:Function(IQ#iq{sub_els = [Pkt]}) catch error:{xmpp_codec, Why} -> - Txt = xmpp:format_error(Why), + Txt = xmpp:io_format_error(Why), xmpp:make_error(IQ, xmpp:err_bad_request(Txt, Lang)) end. diff --git a/src/mod_irc_connection.erl b/src/mod_irc_connection.erl index b7b2f8e1d..593365910 100644 --- a/src/mod_irc_connection.erl +++ b/src/mod_irc_connection.erl @@ -418,7 +418,7 @@ handle_info({route_chan, Channel, Resource, end catch _:{xmpp_codec, Why} -> Err = xmpp:err_bad_request( - xmpp:format_error(Why), xmpp:get_lang(Packet)), + xmpp:io_format_error(Why), xmpp:get_lang(Packet)), ejabberd_router:route_error(Packet, Err) end, {next_state, StateName, StateData}; diff --git a/src/mod_mam.erl b/src/mod_mam.erl index 92e905b6e..aed43c21e 100644 --- a/src/mod_mam.erl +++ b/src/mod_mam.erl @@ -491,7 +491,7 @@ process_iq(LServer, #iq{sub_els = [#mam_query{xmlns = NS}]} = IQ) -> process_iq(#iq{type = set, lang = Lang, sub_els = [#mam_prefs{default = undefined, xmlns = NS}]} = IQ) -> Why = {missing_attr, <<"default">>, <<"prefs">>, NS}, - ErrTxt = xmpp:format_error(Why), + ErrTxt = xmpp:io_format_error(Why), xmpp:make_error(IQ, xmpp:err_bad_request(ErrTxt, Lang)); process_iq(#iq{from = #jid{luser = LUser, lserver = LServer}, to = #jid{lserver = LServer}, diff --git a/src/mod_muc_room.erl b/src/mod_muc_room.erl index ff63ad067..67a1a2bd3 100644 --- a/src/mod_muc_room.erl +++ b/src/mod_muc_room.erl @@ -251,7 +251,7 @@ normal_state({route, <<"">>, try xmpp:decode_els(Packet) of Pkt -> process_normal_message(From, Pkt, StateData) catch _:{xmpp_codec, Why} -> - Txt = xmpp:format_error(Why), + Txt = xmpp:io_format_error(Why), Err = xmpp:err_bad_request(Txt, Lang), ejabberd_router:route_error(Packet, Err), StateData @@ -329,7 +329,7 @@ normal_state({route, <<"">>, end end catch _:{xmpp_codec, Why} -> - ErrTxt = xmpp:format_error(Why), + ErrTxt = xmpp:io_format_error(Why), Err = xmpp:err_bad_request(ErrTxt, Lang), ejabberd_router:route_error(IQ0, Err) end; diff --git a/src/mod_multicast.erl b/src/mod_multicast.erl index e10315b7a..7b772521d 100644 --- a/src/mod_multicast.erl +++ b/src/mod_multicast.erl @@ -240,7 +240,7 @@ handle_iq(Packet, State) -> end catch _:{xmpp_codec, Why} -> Lang = xmpp:get_lang(Packet), - Err = xmpp:err_bad_request(xmpp:format_error(Why), Lang), + Err = xmpp:err_bad_request(xmpp:io_format_error(Why), Lang), ejabberd_router:route_error(Packet, Err) end. diff --git a/src/mod_privacy.erl b/src/mod_privacy.erl index c4a1c471d..64ae9620e 100644 --- a/src/mod_privacy.erl +++ b/src/mod_privacy.erl @@ -353,7 +353,7 @@ process_lists_set(#iq{from = #jid{luser = LUser, lserver = LServer} = From, lang = Lang} = IQ, Name, Items) -> case catch lists:map(fun decode_item/1, Items) of {error, Why} -> - Txt = xmpp:format_error(Why), + Txt = xmpp:io_format_error(Why), xmpp:make_error(IQ, xmpp:err_bad_request(Txt, Lang)); List -> case set_list(LUser, LServer, Name, List) of diff --git a/src/mod_privilege.erl b/src/mod_privilege.erl index 6ba061a53..dab7a619b 100644 --- a/src/mod_privilege.erl +++ b/src/mod_privilege.erl @@ -292,7 +292,7 @@ forward_message(#message{to = To} = Msg) -> Err = xmpp:err_bad_request(Txt, Lang), ejabberd_router:route_error(Msg, Err) catch _:{xmpp_codec, Why} -> - Txt = xmpp:format_error(Why), + Txt = xmpp:io_format_error(Why), Err = xmpp:err_bad_request(Txt, Lang), ejabberd_router:route_error(Msg, Err) end; diff --git a/src/mod_proxy65_service.erl b/src/mod_proxy65_service.erl index 4a4729dcf..fb34ba554 100644 --- a/src/mod_proxy65_service.erl +++ b/src/mod_proxy65_service.erl @@ -189,12 +189,12 @@ process_bytestreams(#iq{type = set, lang = Lang, sub_els = [#bytestreams{sid = SID}]} = IQ) when SID == <<"">> orelse size(SID) > 128 -> Why = {bad_attr_value, <<"sid">>, <<"query">>, ?NS_BYTESTREAMS}, - Txt = xmpp:format_error(Why), + Txt = xmpp:io_format_error(Why), xmpp:make_error(IQ, xmpp:err_bad_request(Txt, Lang)); process_bytestreams(#iq{type = set, lang = Lang, sub_els = [#bytestreams{activate = undefined}]} = IQ) -> Why = {missing_cdata, <<"">>, <<"activate">>, ?NS_BYTESTREAMS}, - Txt = xmpp:format_error(Why), + Txt = xmpp:io_format_error(Why), xmpp:make_error(IQ, xmpp:err_jid_malformed(Txt, Lang)); process_bytestreams(#iq{type = set, lang = Lang, from = InitiatorJID, to = To, sub_els = [#bytestreams{activate = TargetJID,