Just look at the exit status of type -p.