Factor out common method _raise_not_found

Change-Id: Ia06af39013403b2b443f5549c14936995f02f140
Merge "Factor out common method _raise_not_found"