anchor.diff:              case (catch list_to_integer(Value)) of
               Count when is_integer(Count) ->
                   if Count < 0 ->
  -                    Args#view_query_args {
  -                        direction =
  -                        if Args#view_query_args.direction == rev -> fwd;
  -                        true -> rev
  -                        end,
  -                        count=Count,
  -                        start_key = reverse_key_default(Args#view_query_args.start_key),
  -                        start_docid = reverse_key_default(Args#view_query_args.start_docid),
  -                        end_key = reverse_key_default(Args#view_query_args.end_key),
  -                        end_docid =  reverse_key_default(Args#view_query_args.end_docid)};
  +                    Msg = io_lib:format("Count must be a positive integer: count=~s", [Value]),
  +                    throw({query_parse_error, Msg});
                   true ->
                       Args#view_query_args{count=Count}
                   end;
  
positive.code:     #view_query_args{
          end_key = EndKey,
          end_docid = EndDocId,
          direction = Dir,
          count = Count
      } = QueryArgs,
  
      PassedEndFun =
  
negative.code:             send_chunk(Resp, ",\r\n" ++  ?JSON_ENCODE(JsonObj)),
              {ok, {AccCount - 1, 0, Resp, AccRevRows}}
          end
      end.
  
  finish_view_fold(Req, TotalRows, FoldResult) ->
  