why not put this generic error in findInPath, to avoid reduplication