[builder] Fix lexer error handling