Refined error message display logic.