Improved error messaging in PitchHandler.