Debug code for Water quality errors