anchor.diff:  get_next_line(<<?NEWLINE, Data/binary>>, Acc, Part, State) -> {<<Acc/binary>>, Data, Part, State};
   get_next_line(<<C, Data/binary>>, Acc, Part, State) -> get_next_line(Data, <<Acc/binary, C>>, Part, State);
   get_next_line(Data, Acc, Part, State) when Data == undefined orelse Data == <<>> ->
  -    {Data1, State1} = read_chunk(State),
  -
  -    % We don't want Acc to grow too big, so if we have more than ?CHUNKSIZE 
  -    % data already read, then flush it to the current part.
  -    {Acc1, Part1} = case Part /= undefined andalso size(Acc) > ?CHUNKSIZE of
  -                        true -> {<<>>, update_part_with_value(Acc, false, Part)};
  -                        false -> {Acc, Part}
  -                    end,
  +    {Data1, State1, Acc1, Part1} =
  +    try
  +        {TmpData1, TmpState1} = read_chunk(State),
  +        % We don't want Acc to grow too big, so if we have more than ?CHUNKSIZE
  +        % data already read, then flush it to the current part.
  +        {TmpAcc1, TmpPart1} = case Part /= undefined andalso size(Acc) > ?CHUNKSIZE of
  +                                  true -> {<<>>, update_part_with_value(Acc, false, Part)};
  +                                  false -> {Acc, Part}
  +                              end,
  +        {TmpData1, TmpState1, TmpAcc1, TmpPart1}
  +    catch
  +        throw : Reason -> throw({Reason, State})
  +    end,
       % it into a part.
       get_next_line(Data1, Acc1, Part1, State1).
   
  
positive.code:             read_part_header(Data1, #part {}, State2);
          A when A == start_value orelse A == continue ->
              % Write the line, then continue...  
              Part2 = update_part_with_value(Line, true, Part1),
              read_part_value(Data1, Part2, State1);
          eof ->
              update_state_with_part(Part1, State1)
  
negative.code:     try
          Boundary = get_multipart_boundary(Req),
          Length = get_content_length(Req),
          ok = crash_if_too_big(Length, #state{parts = []}),
          Data = get_opening_body(Req), 
          State = init_state(Req, Boundary, Length, Data),
          State1 = read_boundary(Data, State),
          {Params, Files} = process_parts(State1#state.parts),
          {ok, Params, Files}
      catch
          throw : {Reason, ErrState} ->
              lists:foreach(fun(Part) ->
                  file:delete(Part#sb_uploaded_file.temp_file)
              end, convert_parts_to_files(ErrState#state.parts)),
              {error, Reason}
      end.
  
  get_content_length(Req) ->
  