In a medium saucepan, melt butter over medium heat. Stir sugar into the melted butter. Add the onions and shallots. Cook, stirring frequently, about 15 minutes or until vegetables are very tender and golden brown. Stir in mushrooms, wine or vinegar, herbs, salt and pepper. Cook and stir for 2 minutes more. In a small bowl, stir together sour cream, half-and-half or light cream, and flour. Add to mushroom mixture. Cook and stir till bubbly. Cook and stir for 1 minute more.