Group error message, write different error msg for different errors