You not say which way round you are testing (I would use A/B), so maybe this...

If you only want the error removed...
=IF(A2=0,"",B2/A2)
or this if you want everything removed...
=IF(OR(A2=0,B2=0),"",B2/A2)