Extracted internal error builder