- info(StreamID, Info={'EXIT', Pid, normal}, State=#state{pid=Pid}) ->
- do_info(StreamID, Info, [stop], State);
- info(StreamID, Info={'EXIT', Pid, {{request_error, Reason, _HumanReadable}, _}},
- State=#state{pid=Pid}) ->
- Status = case Reason of
- timeout -> 408;
- payload_too_large -> 413;
- _ -> 400
- end,
- %% @todo Headers? Details in body? Log the crash? More stuff in debug only?
- do_info(StreamID, Info, [
- {error_response, Status, #{<<"content-length">> => <<"0">>}, <<>>},
- stop
- ], State);
- info(StreamID, Exit={'EXIT', Pid, {Reason, Stacktrace}}, State=#state{ref=Ref, pid=Pid}) ->