In the following, I get a perhaps a missing \item error each time a chapter is processed. This occurred only after the second compilation, once the table of contents information is built. Below I have a MWE where the offending code is near the top. That code is to ensure that the "leading dots" and page number for the "mini table of contents" inserted below the chapter title are printed in black instead of the default color. The result looks the way I want it, in spite of the errors. I have included a little bit more code below than that strictly required for a MWE as I want to avoid solutions that would mess up other important parts (for instance the full table of contents).
How could I fix this to avoid these error messages --- while still getting error messages if truly missing \items elsewhere.
\documentclass[11pt,openany]{memoir}
\usepackage{titletoc}
\usepackage{lipsum}
%%%%%% Problem code is here
\titlecontents{section}
[10em] % left margin
{}% font formatting
{\contentslabel{3em}} % section label and offset
{}
{\color{black}\titlerule*[1pc]{.}\contentspage}
%%%%%%%% end of problem code
\usepackage{color,calc}
\definecolor{ChapRed}{rgb}{.600,.100,.100}
\setsecheadstyle{\color{ChapRed}\large\bfseries}
% coloured chapter font in toc
\let\oldcftchapterfont=\cftchapterfont
\renewcommand{\cftchapterfont}{\color{ChapRed}\oldcftchapterfont}
%% adapted from BlueBox style, pp:43-44
% http://mirror.csclub.uwaterloo.ca/CTAN/info/latex-samples/MemoirChapStyles/MemoirChapStyles.pdf
\newcommand{\RedBarLength}{5em}
\newsavebox{\ChpNumBox}
\makeatletter
\newcommand*{\thickhrulefill}{%
\leavevmode\leaders\hrule height 1\p@ \hfill \kern \z@}
\newcommand*\BuildChpNum[2]{%
\begin{tabular}[t]{@{}c@{}}
\makebox[0pt][c]{#1\strut} \\[.5ex]
\colorbox{ChapRed}{%
\rule[-\RedBarLength]{0pt}{0pt}%
\rule{1ex}{0pt}\color{white}#2\strut
\rule{1ex}{0pt}}%
\end{tabular}}
\makechapterstyle{RedBox}{%
\renewcommand{\chapnamefont}{\large\scshape}
\setlength{\beforechapskip}{-30pt}
\setlength{\midchapskip}{10pt}
\setlength{\afterchapskip}{30pt}
\renewcommand{\printchaptername}{}
\renewcommand{\chapternamenum}{}
\renewcommand{\printchapternum}{%
\sbox{\ChpNumBox}{%
\BuildChpNum{\chapnamefont\@chapapp}%
{\chapnumfont\thechapter}}}
\renewcommand{\printchapternonum}{%
\sbox{\ChpNumBox}{%
\BuildChpNum{\chapnamefont\vphantom{\@chapapp}}%
{\chapnumfont\hphantom{\thechapter}}}}
\renewcommand{\afterchapternum}{}
\renewcommand{\printchaptertitle}[1]{%
\usebox{\ChpNumBox}\hfill
\parbox[t]{\hsize-\wd\ChpNumBox-1em}{%
\vspace{\midchapskip}%
\thickhrulefill\\[10pt]
{\chaptitlefont \textcolor{ChapRed}{##1}}\\
\startcontents[chapters]
\printcontents[chapters]{}{1}{\color{ChapRed}}
}}%
}
\chapterstyle{RedBox}
\begin{document}
\tableofcontents
\chapter{A chapter}
\section{Section}
\lipsum[1]
\section[Short title for this section]{Section 2 with a very, very long title which probably takes more than one line}
\lipsum[1]
\renewcommand{\RedBarLength}{10em}
\chapter{Second chapter}
\section{Section}
\lipsum[1]
\section{Another section}
\lipsum[1]
\section{Another section}
\section{Another section}
\section{Another section}
\section{Another section}
\end{document}
\addvspacecommand when encountered in horizontal mode. The follow-up remark about "perhaps a missing\itemis unfortunately seldom correct. The problematic code is imho not in the\titlecontents: It only clashes with something you are doing in the long chapter redefinitions. – Ulrike Fischer Mar 29 '12 at 09:08