pwm error handling