Коммит 09b96830 создал по автору Sergey Prokhorov's avatar Sergey Prokhorov
Просмотр файлов

Handle non-200 HTTP response codes as errors

владелец c129af6d
......@@ -199,11 +199,15 @@ do_stop_http_poll(#state{active=true, method=longpoll,
State#state{active=false, method_state=undefined}.
handle_http_poll_msg({status, Status, _Reason},
handle_http_poll_msg({status, 200 = Status, _Reason},
#state{method_state = #{state := start,
status := undefined}=MState} = State) ->
%% XXX: maybe assert Status == 200?
{ok, State#state{method_state = MState#{state := status, status := Status}}};
handle_http_poll_msg({status, Status, _Reason},
#state{method_state = MState, name = Name} = State) ->
error_logger:warning_msg("Bot ~p: longpool bad status ~p when state ~p",
[Name, Status, MState]),
{invariant, State#state{method_state = undefined, active=false}};
handle_http_poll_msg({headers, Headers},
#state{method_state = #{state := status,
headers := undefined}=MState} = State) ->
......
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать