diff options
author | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2016-03-31 11:00:29 +0300 |
---|---|---|
committer | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2016-03-31 11:00:29 +0300 |
commit | fced8dc3d926ef733775725225a437c2c1656a4f (patch) | |
tree | 7d66931a79e0767bf25ff78820619961d5bddca9 /src/mod_http_upload.erl | |
parent | b160bd7ac15e7ad946968fa75024cc33f3a30086 (diff) |
Replace some ?ERR_* macros with ?ERRT_*
Diffstat (limited to 'src/mod_http_upload.erl')
-rw-r--r-- | src/mod_http_upload.erl | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mod_http_upload.erl b/src/mod_http_upload.erl index 6c029c437..214badca5 100644 --- a/src/mod_http_upload.erl +++ b/src/mod_http_upload.erl @@ -569,7 +569,8 @@ process_iq(From, deny -> ?DEBUG("Denying HTTP upload slot request from ~s", [jid:to_string(From)]), - IQ#iq{type = error, sub_el = [SubEl, ?ERR_FORBIDDEN]} + Txt = <<"Denied by ACL">>, + IQ#iq{type = error, sub_el = [SubEl, ?ERRT_FORBIDDEN(Lang, Txt)]} end; process_iq(_From, #iq{sub_el = SubEl} = IQ, _State) -> IQ#iq{type = error, sub_el = [SubEl, ?ERR_NOT_ALLOWED]}; @@ -601,7 +602,8 @@ parse_request(#xmlel{name = <<"request">>, attrs = Attrs} = Request, Lang) -> {error, ?ERRT_BAD_REQUEST(Lang, Text)} end; _ -> - {error, ?ERR_BAD_REQUEST} + Text = <<"No or invalid XML namespace">>, + {error, ?ERRT_BAD_REQUEST(Lang, Text)} end; parse_request(_El, _Lang) -> {error, ?ERR_BAD_REQUEST}. @@ -639,7 +641,7 @@ create_slot(#state{service_url = undefined, end; create_slot(#state{service_url = ServiceURL}, #jid{luser = U, lserver = S} = JID, File, Size, ContentType, - _Lang) -> + Lang) -> Options = [{body_format, binary}, {full_result, false}], HttpOptions = [{timeout, ?SERVICE_REQUEST_TIMEOUT}], SizeStr = jlib:integer_to_binary(Size), @@ -659,7 +661,8 @@ create_slot(#state{service_url = ServiceURL}, Lines -> ?ERROR_MSG("Can't parse data received for ~s from <~s>: ~p", [jid:to_string(JID), ServiceURL, Lines]), - {error, ?ERR_SERVICE_UNAVAILABLE} + Txt = <<"Failed to parse HTTP response">>, + {error, ?ERRT_SERVICE_UNAVAILABLE(Lang, Txt)} end; {ok, {402, _Body}} -> ?INFO_MSG("Got status code 402 for ~s from <~s>", |