Correctly raise the NoIdError exception

Change-Id: I11861d9f877778dd6144e91d183f47582a52e03a